• Hi,
    I am using the Tanzaku theme. I am trying to set up template pages with custom field – category=******

    I then want the template to only show posts from that category.
    Can you advise what I need to do code-wise,

    I have found this part in the code:

    // use this code if you want filter items by category.
    	$arr_catID = array();
    	foreach( get_the_category() as $cat) $arr_catID[] = $cat->cat_ID;
    	if ( count($arr_catID) ) $new_query_arg .= '&cat=' . join(',', $arr_catID);

    Which part of the above should I edit to find what category custom field it is and then only show posts from that category????

    Please help – its driving me mad.
    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I am having a similar problem. When I click on any category, the pages are blank. What should I do to get it working?

    Go here: seabats.com and try clicking ony any category and you’ll see what I mean. Thanks in advance

    maybe answer here
    see u (really late answer, but new comer !)

    comment out the above code and try this code;

    <?php
    $cat_name = get_post_meta($post->ID, "category", true);
    $my_query = new WP_Query('category_name= '. $cat_name);
     while ($my_query->have_posts()) : $my_query->the_post();$do_not_duplicate = $post->ID;
    ?>
    <div id="post-title"> <?php the_title();?></div>
    ..........
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Tanzaku category query’ is closed to new replies.