ThemeShaper Forums » Thematic

[closed]

Editing Post Meta in Functions.php

(2 posts)
  • Started 4 years ago by MetaMakers
  • Latest reply from MetaMakers
  • This topic is not resolved
  1. Hello, I can't even express how much fun I'm having learning CSS and WP through Thematic as a parent theme- it's amazing! However, I am having trouble wrapping my head around PHP and action hooks. I would like to change the post-meta and have used a few helpful threads on the forum like Edit Post Meta Data and Filter Post Meta .

    I can copy and paste these codes into my functions.php, but it doesn't quite get what I'm going for. Rather than the thematic default that goes something like:

    Post title
    By AUTHOR'S NAME | Published DATE

    I would like my post-meta to be:

    CATEGORY
    Post Title
    Date

    I would like to remove the italicized "By" and "Published". I would also like to understand what part of functions.php controls how the date is capitalized in the thematic default (I want to make my Catagory all caps and make the date lowercase).

    PS- My site can be accessed by clicking my username. Thanks!!!

    Posted 4 years ago #
  2. This is the current code in my functions.php:

    <?php
    
    function custom_postmeta($postmeta){
     $postmeta = '<div class="entry-meta">';
        $postmeta .= 'Posted on ';
        $postmeta .= '<span class="entry-date"><abbr class="published" title="';
        $postmeta .= get_the_time(thematic_time_title()) . '">';
        $postmeta .= get_the_time(thematic_time_display());
        $postmeta .= '</abbr></span>';
        $postmeta .= " in " . get_the_category_list(', ');
        // Display edit link
        if (current_user_can('edit_posts')) {
            $postmeta .= ' <span class="meta-sep">|</span> ' . $posteditlink;
        }
        $postmeta .= "</div><!-- .entry-meta -->\n";
    return $postmeta;
    }
    add_filter('thematic_postheader_postmeta', 'custom_postmeta');
    
    function my_postheader() {
    
        global $post;
    
        if ($post->post_type == 'page' || is_404()) {
            $postheader = thematic_postheader_posttitle();
        } else {
            $postheader = thematic_postheader_postmeta() . thematic_postheader_posttitle();
        }
    	return $postheader;
    }
    add_filter('thematic_postheader', 'my_postheader' );
    
    ?>
    Posted 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.