Forums

wp_list_categories showing all post of the blog instead of all category posts. (1 post)

  1. anthoula
    Member
    Posted 5 months ago #

    I'm using wp_list_categories to display a list of links of each category. When I click on the link, I get ALL blog posts instead of just the posts of that selected category.

    Here is the website: http://www.storyboardart.org/?cat=4

    The category links are in the right sidebar. This problem is on the Blogs page, as well as the News page.

    Here is the code that generates the list.
    `<?php
    $cate = ($_GET['cat']) ? $_GET['cat']:4;
    $post = $wp_query->post;
    $post_cats = wp_get_post_categories($post->ID);
    //print_r($post_cats);
    if ( in_array('3',$post_cats) ) $cate = 3;
    elseif(in_array('4',$post_cats)||in_array('6',$post_cats)) $cate = 4;
    ?>

    <ul id="bloglist">
    <?php wp_list_categories('orderby=name&child_of='.$cate.'&title_li=&show_count=1'); ?>
    '

    The client thinks it has something to do with Permalinks. Permalinks are set to Numeric.

    Any ideas to explore?

Reply

You must log in to post.

About this Topic