• Hello all,

    My problem is fairly common : I would like to display the post list of a specific category on a page under the same style as search results for instance.

    To do so, I built a new function in the function.php of my child theme:

    add_action(‘__before_loop’, ‘display_list’, 5);

    function display_list($query){
    if ( ! is_page(‘learn’) ){ //’learn is the slug of my page on which I want to display the post list
    return;
    }
    query_posts(‘post_type=post&cat=3&paged=’. get_query_var(‘paged’));
    // 3 is the category ID of the posts I want to display
    add_action(‘__after_article_container’, ‘wp_reset_query’, 5);
    }

    But nothing is dislayed on my page “learn”.

    Anyone could help me ?
    Thanks a lot,
    M.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Theme Customizr – Can't display a post list’ is closed to new replies.