• http://www.groupemilagro.com

    I’m using the CTC (Configurable Tag Cloud) and this is happening:

    If you click on a category in the tag cloud on the bottom right ~3/4 times it will bring you to the wrong category. For example clicking on “Media” will almost NEVER bring you to the “Media” section.

    The weirdest part is if you close the browser and try again it will usually bring you to a DIFFERENT section the the last time! For example, I click “Media”, I get directed to “Bad Relationships” then I close the browser and re-open, click “Media” and get “News”.

    I’ve tried many techniques on how to handle the permalinks but nothing has fixed/changed the problem. My actual addresses are pointing to the wrong places.

    It’s been a pain in the neck for a while now so all help is appreciated.

    PS: I made this blog from scratch using WP 3.0.4, any dev/design tips/advice/critique/comments is totally appreciated!

    Thanks in advance.

    – Alex

Viewing 6 replies - 1 through 6 (of 6 total)
  • Are these in multiple categories?

    Thread Starter alexDevMilagro

    (@alexdevmilagro)

    Well each post could be in multiple categories.. Not sure what you mean otherwise.

    Without seeing your code it’s difficult to tell. The links point to the correct categories, the address bar shows the correct categories, and looking at the content it’s possible that the posts are from the category linked to.

    Somehow it seems the title is pulled from the 1st post in the array.

    For Example, as far as I can tell the Already one year post, is under at least 3 categories, Politics, Haiti, and International. So the 1st article displayed of any of those categories is Already 1 year. Since Haiti is the 1st category to which that post belongs (they default alphabetically) the title shows up as Haiti instead of the actual of the category archive shown.

    but without seeing the code I’m just being hypothetical.

    Thread Starter alexDevMilagro

    (@alexdevmilagro)

    <div id="mainContent">
    	<div id="categoryPage">
            <div id="rss">
            	 <a href="<?php bloginfo('rss2_url'); ?>"><img id="rss_icon" src="<?php bloginfo('stylesheet_directory'); ?>/images/rss_icon_up.jpg" onMouseOver="over('rss_icon','<?php bloginfo('stylesheet_directory'); ?>/images/rss_icon.jpg');" onMouseOut=	"out('rss_icon','<?php bloginfo('stylesheet_directory'); ?>/images/rss_icon_up.jpg');"width="26" height="26" alt="Follow Milagro on with RSS"/></a>
            </div>
            <?php
            echo $theTitle;
           $category = get_the_category();
    		$theTitle = $category[0]->cat_name;
            ?>
            <h1>Category: <a href="http://www.groupemilagro.com/category/<?php echo $theTitle ?>"><?php echo $theTitle ?></a></h1>
            <?php $args = array(
            	'category_name' => $theTitle,
            	'showposts' => '1000',
            );?>
            <?php query_posts($args);?>
            <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
      		<div class="post" id="post-<?php the_ID(); ?>">
      						<div class="thumb">
                             	<?php
    								if (has_post_thumbnail()){
    									the_post_thumbnail(array(86,10000));
    								} else {?>
    									 <a href="<?php the_permalink() ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/def_thumb.png" alt="Groupe Milagro" title="Groupe Milagro" width="86" height="86"/></a>
    							<?php } ?>
    
                             </div>
                             <h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php echo the_title(); ?></a></h3>
                             <div class="dateTime"><?php the_time('F jS, Y') ?>  by <a href="mailto:<?php the_author_meta('email'); ?>"><?php the_author() ?></a></div>
    
                             <div class="excerpt">
                                <?php the_excerpt() ?>
                             </div>
    
                             <div class="readMore">
                                <a href="<?php the_permalink() ?>/#comments">
    <?php comments_number('No Comments','One Comment','% Comments'); ?></a>  |  <a href="<?php the_permalink() ?>">Read More</a>
                             </div>
    
                             <div class="devider">
                                &nbsp;
                             </div>
    
                         </div>
     		<?php endwhile; ?>
    		<?php endif; ?> 
    
        </div>
    </div>

    As I thought, this is pulling the title from the category which the 1st post belongs.

    Try using conditional comments to test if it is a category page then use single_cat_title() to get the category name. (ie)

    <?php if(is_category()) {single_cat_title();} ?>

    Your modified code is here… http://wordpress.pastebin.com/LkdfJNYV

    Thread Starter alexDevMilagro

    (@alexdevmilagro)

    Awesome dude, I owe you a beer!!!

    THANKS A LOT!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Category links link to wrong category’ is closed to new replies.