Categories
CMS Mastering Development Wordpress

include specific Pages to wp_list_pages with filter

How can i make a simple filter to display only specific pages (include instead of exclude) as an output to wordpress pages widget?

I made this code , but its not working

function specific_pages($output) {

$args = array(
    'include'  => array(147,12,32),
);
$output = get_posts($args);



return $output;
 }
add_filter('wp_list_pages', 'specific_pages');

Leave a Reply

Your email address will not be published. Required fields are marked *