ThemeShaper Forums » Thematic

[closed]

function i added to the postfooter does not show up in entry-utility div

(4 posts)
  • Started 8 years ago by helgatheviking
  • Latest reply from em hr
  • This topic is not resolved
  1. so i was trying to modify my postfooter to include some related posts. i tried to add my function to the very end of the postfooter as stylistically i need it to be the last thing in the entry-utility div.

    so i am calling the function i have for it (which mostly came from: http://www.wprecipes.com/how-to-show-related-posts-without-a-plugin ) as the very last thing.

    and yet the div created by child_related_posts() function is NOT contained w/in the entry-utility div.

    any ideas? i thought it was a css only thing, but i checked the source code and it is clearly not in the proper div.

    little bugger escaped!

    // mod the Post Footer
    function child_postfooter() {
        global $id, $post;
    
        if ($post->post_type == 'page' && current_user_can('edit_posts')) { /* For logged-in "page" search results */
            $postfooter = '<div class="entry-utility">' . thematic_postfooter_posteditlink();
            $postfooter .= "</div><!-- .entry-utility -->\n";
        } elseif ($post->post_type == 'page') { /* For logged-out "page" search results */
            $postfooter = '';
        } else {
            if (is_single()) {
                $postfooter = '<div class="entry-utility">' . thematic_postmeta_authorlink() . thematic_postfooter_postcategory() ;
            } else {
                $postfooter = '<div class="entry-utility">' . thematic_postmeta_authorlink() . thematic_postfooter_postcategory() . thematic_postfooter_postcomments();
            }
            $postfooter .=  child_related_posts() . "</div><!-- .entry-utility -->\n";
        }
    
    return $postfooter;
    }
    add_filter('thematic_postfooter','child_postfooter');
    // end postfooter
    Posted 8 years ago #
  2. I found this looking up "postfooter" in the search as I was looking for the proper syntax for the end of childtheme_override_postfooter() -- did you ever figure out what went wrong here? It's an interesting and, I'm sure, widely germane issue. I wish someone had gotten back to you on this.

    Posted 8 years ago #
  3. you know- i don't think i sorted it out. however, looking at it again now w/ fresh eyes... (and 2 months of thematic experience) i 'think' what happened is that the child_related_posts() function was echoing its content versus returning it. i have found that to mess up expected ordering of elements, but would have to play around a bit to find out if that is the answer.

    Posted 8 years ago #
  4. Helga,

    I looked at http://www.wprecipes.com/how-to-show-related-posts-without-a-plugin and yes you are correct that the issue is you are echoing the related posts loop when you should be storing it in a concatenated string to be returned to the thematic_postfooter via your child_postfooter function.

    Sorry I wish I had seen this sooner but I'm glad to see you're on the right track. Life and work has been a bit of a distraction from the forums for me lately.

    -Gene

    Posted 8 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.