ThemeShaper Forums » Thematic

[closed]

The Category Loop - only show titles

(3 posts)
  • Started 12 years ago by vicky515
  • Latest reply from vicky515
  • This topic is resolved
  1. vicky515
    Member

    Hi there, I'm new to Thematic (and theme development, really), but so far I am really enjoying it!

    My question right now involves the category loop.
    On category pages, I only want to show the titles of the associated posts. Each title being a link to see the full article.

    So, in my functions.php file I have created the following function:

    function childtheme_override_category_loop()  {
    
    	$query_catposts = new WP_Query( 'tag=<?php the_ID(); ?>' );
    
    	while ( $query_catposts->have_posts()) : $query_catposts->the_post(); 
    
        	echo '<li>';
            the_title();
            echo '</li>';
    
    	endwhile;
    
        wp_reset_postdata();
    }
    // end category_loop

    If it isn't obvious, I got most of it from http://codex.wordpress.org/Function_Reference/query_posts
    And it's also probably obvious to seasoned users why this isn't working. I literally just threw it together and hoped it would work lol...

    Two problems...
    1. It shows the titles of all the articles in all the categories. So it doesn't look like my <?php the_ID(); ?> isn't getting caught.
    2. It doesn't make them links. I just haven't figured out how to do that yet...

    Any help would be greatly appreciated.

    Posted 12 years ago #
  2. vicky515
    Member

    Me again... So I overcomplicated that more than I needed to.
    Here's an updated version that works.

    function childtheme_override_category_loop()  {
    
    while (have_posts()) : the_post();
            echo '<li>';
            the_title();
            echo '</li>';
    
    endwhile;
    
    wp_reset_postdata();
    }

    However, I am completely stumped on how to get the Titles to be links.

    Help? :)

    Posted 12 years ago #
  3. vicky515
    Member

    Buh, I feel stupid.
    Instead of using "the_title()" I copied "thematic_postheader()" and "thematic_postheader_posttitle" functions into new functions and modified as needed.

    Works fine now.

    Thanks anyway.

    Posted 12 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.