ThemeShaper Forums » Thematic

[closed]

Remove Author/Date from Posts?

(9 posts)
  • Started 5 years ago by seamusiv
  • Latest reply from ady_best03
  • This topic is resolved
  1. I don't want the author or date to show up under my post headings. In order to do this, can I copy the related info from the hooks-filters.php into my child theme functions.php file and delete the appropriate lines?

    So change:

    // Information in Post Header
    function thematic_postheader() {
        global $post, $authordata;
    
        if (is_single() || is_page()) {
            $posttitle = '<h1 class="entry-title">' . get_the_title() . "</h1>\n";
        } elseif (is_404()) {
            $posttitle = '<h1 class="entry-title">' . __('Not Found', 'thematic') . "</h1>\n";
        } else {
            $posttitle = '<h2 class="entry-title"><a href="';
            $posttitle .= get_permalink();
            $posttitle .= '" title="';
            $posttitle .= __('Permalink to ', 'thematic') . the_title_attribute('echo=0');
            $posttitle .= '" rel="bookmark">';
            $posttitle .= get_the_title();
            $posttitle .= "</a></h2>\n";
        }
    
        $postmeta = '<div class="entry-meta">';
        $postmeta .= '<span class="author vcard">';
        $postmeta .= __('By ', 'thematic') . '<a class="url fn n" href="';
        $postmeta .= get_author_link(false, $authordata->ID, $authordata->user_nicename);
        $postmeta .= '" title="' . __('View all posts by ', 'thematic') . get_the_author() . '">';
        $postmeta .= get_the_author();
        $postmeta .= '</a></span><span class="meta-sep"> | </span>';
        $postmeta .= '<span class="entry-date"><abbr class="published" title="';
        $postmeta .= get_the_time('Y-m-d\TH:i:sO') . '">';
        $postmeta .= get_the_time('F j, Y');
        $postmeta .= '</abbr></span>';
        $postmeta .= "</div><!-- .entry-meta -->\n";
    
        if ($post->post_type == 'page' || is_404()) {
            $postheader = $posttitle;
        } else {
            $postheader = $posttitle . $postmeta;
        }
    
        echo apply_filters( 'thematic_postheader', $postheader ); // Filter to override default post header

    to:

    // Information in Post Header
    function child_postheader() {
        global $post, $authordata;
    
        if (is_single() || is_page()) {
            $posttitle = '<h1 class="entry-title">' . get_the_title() . "</h1>\n";
        } elseif (is_404()) {
            $posttitle = '<h1 class="entry-title">' . __('Not Found', 'thematic') . "</h1>\n";
        } else {
            $posttitle = '<h2 class="entry-title"><a href="';
            $posttitle .= get_permalink();
            $posttitle .= '" title="';
            $posttitle .= __('Permalink to ', 'thematic') . the_title_attribute('echo=0');
            $posttitle .= '" rel="bookmark">';
            $posttitle .= get_the_title();
            $posttitle .= "</a></h2>\n";
        }
    
        if ($post->post_type == 'page' || is_404()) {
            $postheader = $posttitle;
        } else {
            $postheader = $posttitle . $postmeta;
        }
    
        echo apply_filters( 'thematic_postheader', $postheader ); // Filter to override default post header

    Is that right?

    Posted 5 years ago #
  2. That's exactly what you do with your functions.php.

    Cheers

    Posted 5 years ago #
  3. Okay, I did this, but it didn't work. Then I realized I hadn't changed the echo apply_filters( 'thematic_postheader', $postheader ); line to echo apply_filters( 'child_postheader', $postheader );. But it still doesn't work.

    Is there something I'm missing? Do I need to enable my functions.php file somewhere?

    This is what I have in my functions.php file right now:

    <?php
    
    // Information in Post Header
    function child_postheader() {
        global $post, $authordata;
    
        if (is_single() || is_page()) {
            $posttitle = '<h1 class="entry-title">' . get_the_title() . "</h1>\n";
        } elseif (is_404()) {
            $posttitle = '<h1 class="entry-title">' . __('Not Found', 'thematic') . "</h1>\n";
        } else {
            $posttitle = '<h2 class="entry-title"><a href="';
            $posttitle .= get_permalink();
            $posttitle .= '" title="';
            $posttitle .= __('Permalink to ', 'thematic') . the_title_attribute('echo=0');
            $posttitle .= '" rel="bookmark">';
            $posttitle .= get_the_title();
            $posttitle .= "</a></h2>\n";
        }
    
        if ($post->post_type == 'page' || is_404()) {
            $postheader = $posttitle;
        } else {
            $postheader = $posttitle . $postmeta;
        }
    
        echo apply_filters( 'child_postheader', $postheader ); // Filter to override default post header
    }
    
    ?>
    Posted 5 years ago #
  4. There's a working example of a filtered post header in the post titled Custom WordPress Hooks and Filters in Thematic 0.6.

    Posted 5 years ago #
  5. Good god, don't know how I missed that. Thanks for passing along. Fixed the problem straightup.

    Posted 5 years ago #
  6. I'm currently trying to figure out how to get rid of postheaders completely. I am using the All-in-one SEO plugin to set my descriptions and titles. Somehow google is showing completely different descriptions than my meta descriptions (as set by excerpt and the plugin) so I'm thinking it could be due to <?php thematic_postheader(); ?>

    could i just remove this from the functions.php file in the thematic folder (rather than use filters and my own functions.php file...? i know that defeats the purpose of child themes but it is a lot easier!)

    also could someone enlighten me on the purpose of thematic_postheader and <div id="post-<?php the_ID(); ?>" class="<?php thematic_post_class(); ?>">

    how would deleting this affect my pages?

    thank you!

    Posted 5 years ago #
  7. Never ever do this to Thematic! .. You'll lose all changes with an update and we can't support you if you run into any problem with a changed Thematic.

    Get the current version from Thematic - Google Code and follow these instructions: Double meta description after platinum seo pack

    Removing thematic_postheader would result in having no titles and no entry-meta above your posts and would definitely not cure the multiple description tags.

    thematic_post_class() will create different classes related to a specific post, for instance post number x on this page, author, category, year and month and day (published). These classes allow you to create a special design for let's say all posts published by a certain author.

    Cheers,

    Chris

    Posted 5 years ago #
  8. thanks for such a quick response!

    often i found that making additions/changes to my functions.php file just screws up my page, i'm obviously doing it wrong somewhere!!! i just tried it again and failed miserably :p

    One of the google descriptions that turned up in a keyword search (creatine side effects) was this:

    This entry was posted in Creatine FAQs, Risks Side Effects & Benefits and tagged adolescents, AGAT, ... Creatine risks and side effects. Share this article: ...

    Any idea where this would have come from? My guess was post meta tags in the footer so i also wanted to get rid of postfooter. I have both excerpts and All-in-one SEO description filled out (with the same information). I need to solve this meta description tags fast as rankings have dropped massively since making over the website from html to wordpress!

    THanks for the support!

    Posted 5 years ago #
  9. ady_best03
    Member

    hi everyone and sorry if I bothered. i am trying to build a website on my localhost server and i am using a free wordpress template/theme. i noticed here some discussions about removing date, time, author and category from posts. the problem is i cant figure it out and i cant do it. i tried with some different plugins but it didnt work. i also tried changing and editing different php files but the date, time and category still appears in the posts. can anyone help me with this matter? the templates name i am using is ''Travel-5'' by Ankur Mittal...
    thanks in advance!!!

    Posted 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.