• Resolved ickkfan

    (@ickkfan)


    Hi all,

    I have just upgraded to version 3.0, and single_cat_title seems to have stopped working in my array, the category title won’t display anymore

    here is the code, i’d really appreciate any assistance on this

    <?php
    $display_categories = array(8,1,28,11);
    foreach ($display_categories as $category) { ?>
        <div class="clearfloat">
          <?php query_posts("showposts=1&cat=$category");
    	    $wp_query->is_category = false;
    		$wp_query->is_archive = false;
    		$wp_query->is_home = true;
    		 ?>
          <h3><a href="<?php echo get_category_link($category);?>">
    
    <?php single_cat_title(); ?>
            </a>
    </h3>
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter ickkfan

    (@ickkfan)

    got around the problem by using get_cat_name instead

    Can you please elaborate?

    I encountered the exact same issue. After replacing “single_cat_title” with “get_cat_name” I am getting even worse problems. I’ve played around with it a bit, but I’m still pretty fresh when it comes to php.
    It looks like we’re both running the same theme maybe?

    <div id="rightcol">
        <?php
    // enter the IDs of which categories you want to display
    $display_categories = array(3,24,7,12,174,15,41,9,8,11,25,16,72);
    foreach ($display_categories as $category) {
    $count = 0; // Set the post counter ?>
        <div class="clearfloat">
          <?php query_posts("showposts=4&cat=$category"); // Set showposts to 4 - 1 with excerpt and 3 without
    	    $wp_query->is_category = false;
    		$wp_query->is_archive = false;
    		$wp_query->is_home = true;
    		 ?>
          <h3><a href="<?php echo get_category_link($category);?>">
            <?php
    	// name of each category gets printed
    	  single_cat_title(); ?>
            </a></h3>
    
         <?php while (have_posts()) : the_post(); ?>
          <?php
    // Checks if this is the first post of each category
          if ($count == 0) {
    
    // this grabs the image filename
    	$values = get_post_custom_values("rightcolimage");
    // this checks to see if an image file exists
    	if (isset($values[0])) {
    ?>

    Well, Im very bad with PHP, could someone tell me how to solve it in this case?

    <h3 class="catt-<?php echo $cp_pC; ?>"><a href="<?php echo get_category_link( $cp_pC ); ?>"><?php single_cat_title(''); ?> &raquo;</a></h3>

    Im using the Arthemia theme and it has this code in the sidebar.php

    Change

    <?php single_cat_title(''); ?>

    to

    <?php echo get_cat_name($cp_pC); ?>.

    It will work.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘problems with single_cat_title after upgrading to 3.0’ is closed to new replies.