ThemeShaper Forums » Thematic

Excerpt on front page -- "childtheme_override_content_init()" never called?

(5 posts)
  • Started 1 year ago by McSalty
  • Latest reply from em hr
  • This topic is resolved
  1. I'm trying to output excerpts on the homepage instead of full posts. In order to do so, I've added the following to my functions.php:

    function childtheme_override_content_init() {
            global $thematic_content_length;
    
            $content = '';
            $thematic_content_length = '';
    
            if (is_home() || is_front_page()) {
                    $content = 'excerpt';
            } elseif (is_single()) {
                    $content = 'full';
            } elseif (is_tag()) {
                    $content = 'excerpt';
            } elseif (is_search()) {
                    $content = 'excerpt';
            } elseif (is_category()) {
                    $content = 'excerpt';
            } elseif (is_author()) {
                    $content = 'excerpt';
            } elseif (is_archive()) {
                    $content = 'excerpt';
            }
    
            $thematic_content_length = apply_filters('thematic_content', $content);
    }

    (I just copied the contents of thematic_content_init(), and changed 'full' to 'excerpt')

    However, this has no effect, as if this function were never called. Any ideas?

    Posted 1 year ago #
  2. I had to use "childtheme_override_content()" anyway, so I ended up pasting

    if (!is_single()) $thematic_content_length = 'excerpt';

    As my first line. This works, but isn't clean. What is the purpose of thematic_content_init() if it isn't automatically called before thematic_content()?

    Posted 1 year ago #
  3. Are you sure the thematic_content_init function isn't being called? If so how? Trying to fix this problem too =]

    Posted 1 year ago #
  4. After working on this for quite a while, what was missing was you needed to add the action...

    add_action('thematic_abovepost','childtheme_override_content_init');

    I know it seems like you shouldn't have to do this because on line 801 the add_action function is called...

    add_action('thematic_abovepost','thematic_content_init');

    However this is INSIDE the elseif statment, and is only run if the child override function does not exist.

    While my fix works, I propose that the "add_action" line be moved outside of the closing brace.

    Posted 1 year ago #
  5. em hr
    Moderator

    This was fixed in the latest svn.

    -Gene

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.