ThemeShaper Forums » Thematic

[closed]

a trick for getting category.php to use the_content instead of the_excerpt?

(6 posts)
  • Started 3 years ago by snack
  • Latest reply from helgatheviking
  • This topic is not resolved
  1. snack
    Member

    I've used other themes that do this by default. I thought I could change my Reading Settings to display "full text", but it's already set to do that.

    And unfortunately, I can't just modify category.php, because it doesn't actually contain the_exceprt() -- instead it calls thematic_categoryloop() , which is in
    thematic/library/extensions/content-extensions.php .

    This function offers an override -- childtheme_override_category_loop() -- but that doesn't seem the right solution to my problem. I don't want to kill the loop, just tweak it's behavior.

    There's got to be something simple for this, right?

    Posted 3 years ago #
  2. Hi, I use this one all the time, found here on the forums, put this in your functions.php

    function remove_categoryloop() {
        remove_action('thematic_categoryloop', 'thematic_category_loop');
    }
    add_action('init', 'remove_categoryloop');
    
    function my_categoryloop() {
    while (have_posts()) : the_post(); ?>
    
              <div id="post-<?php the_ID(); ?>" class="<?php thematic_post_class(); ?>">
                  <?php thematic_postheader(); ?>
                  <div class="entry-content">
    <?php thematic_content(); ?>
    				</div>
                  <?php thematic_postfooter(); ?>
              </div><!-- .post -->
    
          <?php endwhile;
    }
    add_action('thematic_categoryloop', 'my_categoryloop');
    Posted 3 years ago #
  3. snack
    Member

    Thanks joperron. That's basically what I did. I just feel like I'm reinventing the wheel. I expected that I'd just be able to pass basic values to thematic core functions, ie roughly this

    thematic_categoryloop('cat-name', 'display-style' );

    Instead, every time I want to customize it, I have to remove the function from the thematic codebase and bring it into my functions.php. I find myself doing this repeatedly, because the actual function is too far away for me to pass values to. Perhaps if I was a better coder this wouldn't be a problem. As it is, I end up with a huge and not-too-elegant-looking functions file.

    Posted 3 years ago #
  4. i believe you need to filter the thematic_content(). try:

    //change where theme uses excerpts vs full
    function childtheme_content($content) {
    	//full content on category
    	if (is_category()) {
    		$content= 'full';
    	}
    	return $content;
    }
    
    add_filter('thematic_content', 'childtheme_content');
    Posted 3 years ago #
  5. snack
    Member

    will this work in a page with multiple loops?

    Posted 3 years ago #
  6. i dont actually know. why don't you try it and report back and we'll go from there.

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.