function home_slider() {
$path = ROOT . '/inc/short-parts/home_slider.php';
$return = include $path;
return $return;
}
add_shortcode('home_slider', 'home_slider');
Notice the difference between the above examples. The first uses return within the included file while the other does not.Example #5
Почему include, require возвращает 1?Думаю, по тому, что файл удалось подключить. В ином случае, оно бы вернуло вам "0" (т.е. false). Если Вам нужно содержимое файла, а не подключение куска PHP-кода, для этого есть функция file_get_contents() например.