ThemeShaper Forums » Thematic

How to add comment link/number to postheader?

(3 posts)
  • Started 5 years ago by Johnny-Z
  • Latest reply from Johnny-Z
  • This topic is resolved
  1. Hey guys, I'm working on my new child theme & I'm trying to add comment link/number in (or near) postheader, just like in Commune Child Theme:

    http://i28.tinypic.com/2a6456t.jpg

    But all filters that I have written for this in functions.php mess up my child theme.

    Can someone please help me with this? I'm still new to thematic framework and I'm still learning all this so I would really appreciate someones help. Thanks

    Posted 5 years ago #
  2. I am attempting to work on the same thing - Chris has helped. See this thread:
    http://forums.themeshaper.com/topic/how-to-return-a-filter-and-add-a-wp-function

    Posted 5 years ago #
  3. Thanks cathy, I tryed this code and it worked with little bit of customization:

    //add comment link beneath title
    function childtheme_postmeta($postmeta) {
    
        // add the separator
        $postmeta .= ' <span class="meta-sep meta-sep-edit">|</span> ';
    
        // add the additional markup
        $postmeta .= '<span class="meta-comments-number">';
    
    //start of my added code
    	$postmeta .= ' <span class="comment"><a href="' . get_permalink() . '#comments" title="' . __('Comment on ', 'thematic') . the_title_attribute('echo=0') . '">';
        $postmeta .= get_comments_number() . __(' Comments', 'thematic') . '</a></span>';
    //end of my added code
    
        // add the comments_number
        //$postmeta .= comments_number('no responses','one response','% responses');
    
        // close the markup
        $postmeta .= '</span>';
    
        // finally return $postmeta
        return $postmeta;
    }
    
    add_filter('thematic_postheader_postmeta', 'childtheme_postmeta');

    Once again, thank you cathy & Chris :)

    Posted 5 years ago #

RSS feed for this topic

Reply

You must log in to post.