ThemeShaper Forums » Thematic

[closed]

Category fetching problem with cats_meow function

(1 post)
  • Started 3 years ago by tapeter
  • This topic is not resolved
  1. tapeter
    Member

    The cats_meow function seems to be failing to register a current category (Teachers), and consequently it is displaying 'Also posted in Teachers' while in the teachers category. (This is not a problem with other categories, such as 'News). I think it has something to do with that I run an additional query (to sort my posts alphabetically). I've pasted the code of my loop below.

    I'm a PHP newbie, so I don't know much about the interaction of multiple queries, loops, and the scope of variables. Can someone help shed some light on the problem? Thanks so much in advance!

    Sincerely,
    Tim

    <?php the_post(); ?>

    <h1 class="page-title"><span><?php single_cat_title() ?></span></span></h1>
    <?php $categorydesc = category_description(); if ( !empty($categorydesc) ) echo apply_filters( 'archive_meta', '<div class="archive-meta">' . $categorydesc . '</div>' ); ?>

    <?php rewind_posts(); ?>

    <?php global $wp_query; $total_pages = $wp_query->max_num_pages; if ( $total_pages > 1 ) { ?>
    <div id="nav-above" class="navigation">
    <div class="nav-previous"><?php next_posts_link(__( '<span class="meta-nav">«</span> Older posts', 'your-theme' )) ?></div>
    <div class="nav-next"><?php previous_posts_link(__( 'Newer posts <span class="meta-nav">»</span>', 'your-theme' )) ?></div>
    </div><!– #nav-above –>
    <?php } ?>

    <?php if(is_category('teachers')){

    query_posts('meta_key=sortname&orderby=meta_value&order=ASC'); } ?>

    <?php while ( have_posts() ) : the_post(); ?>

    <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

    <h2 class="entry-title">" title="<?php printf( __('Permalink to %s', 'your-theme'), the_title_attribute('echo=0') ); ?>" rel="bookmark"><?php the_title(); ?></h2>

    <div class="entrytext">
    <?php the_content( __( 'Continue reading <span class="meta-nav">»</span>', 'your-theme' ) ); ?>
    </div><!– .entrytext –>

    <div class="entry-utility">

    <?php if ( $cats_meow = cats_meow(', ') ) : ?>
    <span class="cat-links"><?php printf( __( 'Also posted in %s', 'your-theme' ), $cats_meow ) ?></span>
    <span class="meta-sep"> | </span>
    <?php endif ?>

    <?php if(is_category('news')){
    the_tags( '<span class="tag-links"><span class="entry-utility-prep entry-utility-prep-tag-links">' . __('Tagged ', 'your-theme' ) . '</span>', ", ", " | </span>\n" );

    echo "<span>Posted on ";
    echo the_date();
    echo "</span>";
    }
    ?>

    <?php edit_post_link( __( 'Edit', 'your-theme' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t\n" ) ?>
    </div><!– #entry-utility –>

    </div><!– #post-<?php the_ID(); ?> –>

    <?php endwhile; ?>

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.