ThemeShaper Forums » Thematic

[closed]

entry-meta add category

(4 posts)
  • Started 3 years ago by jhkoning
  • Latest reply from JennRost
  • This topic is not resolved
  1. jhkoning
    Member

    Hi there,
    I'm trying to add the post category to the meta area below the post title (but above the content).
    I have re-ordered it using this in the functions.php of my child theme;

    // Functions to change order of Post Meta
    // Removing Thematic's Postmeta
    
    function remove_oldpostmeta() {
    remove_action('thematic_postheader', 'thematic_postheader_postmeta');
    }
    add_action('init', 'remove_oldpostmeta');
    
    //  Creating my new postmeta order
    function sybarity_postheader_postmeta () {
    $postmeta = '<div class="entry-meta">';
        $postmeta .= thematic_postmeta_entrydate();
    $postmeta .= '<span class="meta-sep meta-sep-entry-date"> / </span>';
        $postmeta .= thematic_postmeta_authorlink();
    
        $postmeta .= thematic_postmeta_editlink();
    
        $postmeta .= "</div><!-- .entry-meta -->\n";
    
    return apply_filters('sybarity_postheader_postmeta',$postmeta); 
    
    }
    //  Applying the new postmeta order to Thematic's postheader with a filter
    function sybarity_postheader() {
    
        global $post;
    
        if ($post->post_type == 'page' || is_404()) {
            $postheader = thematic_postheader_posttitle();
        } else {
            $postheader = thematic_postheader_posttitle() . sybarity_postheader_postmeta();
        }
    
    	return $postheader;
    
    }
    
    add_filter('thematic_postheader', 'sybarity_postheader' );

    But I have no idea how to add the category (which I'd like to also be a link if possible).
    I'd like the category to be first, then the date, then the author.
    Thanks in advance,
    Jas

    Posted 3 years ago #
  2. is there something different about your postmeta? it looks almost the same? i would straight up filter it. scrap all of what you posted and try this:

    function sybarity_postheader_postmeta () {
        $postmeta = '<div class="entry-meta">';
        $postmeta .= thematic_postfooter_postcategory();
        $postmeta .= thematic_postmeta_entrydate();
        $postmeta .= '<span class="meta-sep meta-sep-entry-date"> / </span>';
        $postmeta .= thematic_postmeta_authorlink();
    
        $postmeta .= thematic_postmeta_editlink();
    
        $postmeta .= "</div><!-- .entry-meta -->\n";
    
    return $postmeta; 
    
    }
    add_filter('thematic_postheader_postmeta','sybarity_postheader_postmeta');

    is untested, so is possible that i have a typo

    Posted 3 years ago #
  3. jhkoning
    Member

    Thanks for that - will give it a shot & report back,
    Jas

    Posted 3 years ago #
  4. This worked! Except it duplicated the cat-links so that it is now in the entry meta and the postfooter.

    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.