ThemeShaper Forums » Thematic

[closed]

How To Remove Timestamp and By...

(18 posts)
  • Started 5 years ago by VizionQuest
  • Latest reply from helgatheviking
  • This topic is not resolved
  1. VizionQuest
    Member

    I would like to remove the by author's name and the timestamp from underneath each title everywhere (i.e. categories, tags, archives, posts, pages, etc.). For example, I want to remove the following: "By admin | Published: November 19, 2008".

    Thanks for your time and help, it is greatly appreciated.

    Posted 5 years ago #
  2. simply add to your style.css

    .entry-meta {
    display:none;
    }
    Posted 5 years ago #
  3. shelzmike
    Member

    I have not tried this, but I guess it would work. However, my question is a bit beyond this - how can I remove just the By admin and actually leave the Published: Date?

    Mike

    Posted 5 years ago #
  4. Hi Mike,

    the following code will remove the 'By', the author and the separator:

    .entry-meta .meta-prep-author, .entry-meta .author, .entry-meta  .meta-sep-entry-date {
    display:none;
    }

    Try to use Firefox with Firebug to get the related markup.

    Chris

    Posted 5 years ago #
  5. This is related and will probably expose my ignorance on the subject of hooks, filters, actions, etc. I was trying to do this and thought that I would need to remove an action or make a filter (similar to removing the sidebar where I added a filter with a return false in it). Why can this be done with css only? Is there a way to do remove the author information using hooks and filters or does it not apply in the this case.

    Posted 5 years ago #
  6. @elliot: This could as well be done with the functions.php, but by using CSS display:none it will just not be displayed. Good thing is: the information is still there.

    Example: If someone looks at one of your articles in a feedreader where your article pops up among many other articles from other sources (and without your CSS), it is probably a good idea that you just removed the name of the author on your site via CSS.

    Posted 5 years ago #
  7. anthony99
    Member

    If I simply want to remove the separator and the date, will the following code do the job? And will this leave the monthly archives on the right margin unchanged?
    -----------------------------
    .entry-meta .meta-sep-entry-date, .entry-meta .meta-entry-date {
    display:none;
    }
    -----------------------------
    The result would thus be:

    By admin

    Posted 4 years ago #
  8. anthony99
    Member

    Alternatively, can I delete code from thematic/library/extensions/content-extensions to get the same result?

    // Information in Post Header
    function thematic_postheader() {
    global $id, $post, $authordata;

    // @sonofido: //
    // put the next line in if you don't want a title on page //
    if(is_page()) { return; }
    //that should leave any content on a page without title //
    // untested //

    // Create $posteditlink
    $posteditlink .= '<a href="' . get_bloginfo('wpurl') . '/wp-admin/post.php?action=edit&post=' . $id;
    $posteditlink .= '" title="' . __('Edit post', 'thematic') .'">';
    $posteditlink .= __('Edit', 'thematic') . '';
    $posteditlink = apply_filters('thematic_postheader_posteditlink',$posteditlink);

    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 .= "</h2>\n";
    }
    $posttitle = apply_filters('thematic_postheader_posttitle',$posttitle);

    $postmeta = '<div class="entry-meta">';
    $postmeta .= '<span class="meta-prep meta-prep-author">' . __('By ', 'thematic') . '</span>';
    $postmeta .= '<span class="author vcard">'. '<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 .= '</span><span class="meta-sep meta-sep-entry-date"> | </span>';
    $postmeta .= '<span class="meta-prep meta-prep-entry-date">' . __('Published: ', 'thematic') . '</span>';
    $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>';
    // Display edit link
    if (current_user_can('edit_posts')) {
    $postmeta .= ' <span class="meta-sep meta-sep-edit">|</span> ' . '<span class="edit">' . $posteditlink . '</span>';
    }
    $postmeta .= "</div><!-- .entry-meta -->\n";
    $postmeta = apply_filters('thematic_postheader_postmeta',$postmeta);

    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
    } // end thematic_postheader

    Posted 4 years ago #
  9. anthony99
    Member

    Specifically, I should remove this section of code? Or somehow disable it?

    $postmeta .= '</span><span class="meta-sep meta-sep-entry-date"> | </span>';
    $postmeta .= '<span class="meta-prep meta-prep-entry-date">' . __('Published: ', 'thematic') . '</span>';
    $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>';

    Posted 4 years ago #
  10. anthony99
    Member

    I figured it out! I was able to remove everything by using this in the style.css:

    .entry-meta .meta-prep-author, .entry-meta .author, .entry-meta .meta-sep-entry-date, .entry-meta .meta-prep-entry-date, .entry-meta .entry-date{display:none;}

    Now, if I want to put By Author back in, I assume I'll have to take out

    .entry-meta .meta-prep-author, .entry-meta .author

    Posted 4 years ago #
  11. Correct! I'd have thought if you're customising a theme you'd have a basic understanding of CSS but I guess not...

    Posted 4 years ago #
  12. This suggestion does not appear to be working for me. I am working on a site here: http://www.OwlFood.net/demo

    My goal is to have it simply display the title of each post, nothing more, yet the author and timestamp remain.

    Greatly appreciated.

    Posted 4 years ago #
  13. Nevermind! Silly me, I copy/pasted from the site, must have had some erroneous character. I copy/pasted into a text editor first, all good. Awesome! Now if I can get rid of it on the mobile side, I'm golden!

    Posted 4 years ago #
  14. petergus
    Member

    I know this is old but seems like a relevant place to ask it....

    how can we hide it in pages and search results, but still let it apear on post (in the 'blog')?

    Posted 3 years ago #
  15. I would like to know how to remove this using functions, as opposed to hiding with css.

    How would I go about removing the meta-date and entry-utility using hooks?

    Posted 3 years ago #
  16. several ways to skin the cat (where did that phrase come from anyway). to completely remove the post meta you could do:

    add_filter('thematic_postheader','htv_postheader');
    
    function htv_postheader() {
       $postheader = thematic_postheader_posttitle();
       return $postheader;
    }  // end postheader

    or

    add_filter('thematic_postheader','htv_postheader_postmeta');
    
    function htv_postheader_postmeta() {
       //sound of one hand clapping
    }

    or if you wanted to go the function route you could do:

    function childtheme_override_postheader_postmeta(){
       //sound of one hand clapping
    }

    please check out my explanation of hooks and filters:
    http://forums.themeshaper.com/topic/need-help-understanding-actions-vs-filters-and-changing-post-meta-and-utility#post-22638

    Posted 3 years ago #
  17. Nice one, as always! I chose the function route. And what about entry-utility?

    Posted 3 years ago #
  18. it's the same process. take a look in the extensions folder of thematic to find the right filter and function names to target.

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.