ThemeShaper Forums » Thematic


Filter thematic_content plus custom loop

(8 posts)
  • Started 9 years ago by ryancollier
  • Latest reply from ryancollier
  • This topic is resolved
  1. ryancollier

    Okay, so I'm trying to filter thematic_content so that when I'm on my sites homepage (using front-page.php) I get an excerpt. But it's just not working. I'm always getting the full content. If I change is_front_page() to is_home() it works on my blog. So it seems the problem has something to do with my loop in front-page.php? Here's my filter in functions.php:

    function chips_content() {
    	if (is_front_page()) {
    		$content = 'excerpt';
    	return $content;

    Here's my custom loop:

    $featuredPosts = new WP_Query();
    					<?php while ($featuredPosts->have_posts()) : $featuredPosts->the_post(); ?>
    						<div id="post-<?php the_ID(); ?>" class="<?php thematic_post_class(); ?>">
        						<?php thematic_postheader(); ?>
    								<div class="entry-content">
    									<?php thematic_content(); ?>
    							<?php thematic_postfooter(); ?>
    						</div><!-- .post -->
    					<?php endwhile; ?>

    Thanks for your help!

    Posted 9 years ago #
  2. front-page.php is a page template right?
    so instead of


    Hope this helps

    Posted 9 years ago #
  3. ryancollier

    Unfortunately, that didn't work either. I'm not sure, but I feel like I'm totally missing something here...

    It seems like some of my tests work and others don't. For instance, filtering thematic sidebar on the front page works fine, but filtering thematic_content doesn't. I'm wondering if I'm filtering the wrong thing all together or if there's some logic somewhere that's not working because I'm using a page template.

    Posted 9 years ago #
  4. well I did stupidly give you the wrong function name, maybe that is an issue the correct conditional should be

    if(is_page_template('front-page.php') { etc... }

    Rather than is_template(...)

    Posted 9 years ago #
  5. Which version of Thematic are you using? The (currently svn only) is better equipped for this.

    Using that version if you add thematic_abovepost to you loop it should work fine.

    <?php while ($featuredPosts->have_posts()) : $featuredPosts->the_post(); ?>
           <?php thematic_abovepost();?>
           <div id="post-<?php the_ID(); ?>" class="<?php thematic_post_class(); ?>">


    Posted 9 years ago #
  6. ryancollier

    Hey Gene.

    Thanks for your help. I'm using right now, but I can update to the latest and try it out.

    So, can you shed a little light on what adding thematic_abovepost()is going to do for my loop and why that might change conditional tests such as is_front_page() and is_page_template() ?

    Posted 9 years ago #
  7. Hi Ryan,

    If you upgrade to have a look at this thread. I think the functionality you need for my code to work is in the version you are using.

    The thematic_content filter resides in


    which is hooked into thematic_abovepost if you don't have that hook in your custom loop the filter won't get applied properly nor will aspects of the



    Posted 9 years ago #
  8. ryancollier

    Yep. That did it. Thanks all for helping out!

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.