It seems like everytime I start to understand how Thematic works, I run into a situation that has me confused again. So although what I want to achieve is simple, it may require some explaining so that I understand it :)
As a background, typically what I've been doing is finding the function that I need to change, copying and pasting it into my child theme's functions.php file, changing it's name to childtheme_override_whatever, then modifying it as I need. I have a few filters but I feel like I aught to be using them more. Which suggests that I still don't understand them.
Right now, though, I'm staring at my newly pasted childtheme_override_index_loop function and I'm feeling pretty overwhelmed. I find it difficult to understand what exactly is going on in this function to determine what I need to change. And the few helpful loop explanations that I've found aren't specific to Thematic and don't look even remotely close to Thematic's loop.
What I want to do is only show the most recent article in 1 category.
And here's what I'm starting with...
// My Custom Index Loop
function childtheme_override_index_loop() {
global $options, $blog_id;
foreach ($options as $value) {
if (get_option( $value['id'] ) === FALSE) {
$$value['id'] = $value['std'];
} else {
if (THEMATIC_MB)
{
$$value['id'] = get_option($blog_id, $value['id'] );
}
else
{
$$value['id'] = get_option( $value['id'] );
}
}
}
/* Count the number of posts so we can insert a widgetized area */ $count = 1;
while ( have_posts() ) : the_post();
thematic_abovepost(); ?>
<div id="post-<?php the_ID();
echo '" ';
if (!(THEMATIC_COMPATIBLE_POST_CLASS)) {
post_class();
echo '>';
} else {
echo 'class="';
thematic_post_class();
echo '">';
}
thematic_postheader(); ?>
<div class="entry-content">
<?php thematic_content(); ?>
<?php wp_link_pages('before=<div class="page-link">' .__('Pages:', 'thematic') . '&after=</div>') ?>
</div><!-- .entry-content -->
<?php thematic_postfooter(); ?>
</div><!-- #post -->
<?php
thematic_belowpost();
comments_template();
if ($count==$thm_insert_position) {
get_sidebar('index-insert');
}
$count = $count + 1;
endwhile;
}
} // end index_loop
Much thanks in advance.