ThemeShaper Forums » Thematic

[closed]

removing "by author" from post in v 0.9.7.7

(5 posts)
  • Started 8 years ago by onelittlemoose
  • Latest reply from ScottNix
  • This topic is resolved
  1. onelittlemoose
    Member

    I've tried using the code mentioned here to remove the "by author" from the post: http://forums.themeshaper.com/topic/remove-by-author-from-posts

    Unfortunately it throws errors, and I think it's because I'm using a newer version, v 0.9.7.7.

    So, looking here at the Theme Hooks Guide, http://themeshaper.com/thematic/guide/?page_id=10
    I see reference to using "init" as follows:

    // Remove default Thematic actions
    function remove_thematic_actions() {
     remove_action('thematic_hookname','thematic_actionname',optionalpostitionnumber);
    }
    add_action('init','remove_thematic_actions');

    Unfortunately, I lack the skills at present to decipher this into something useful for my situation.

    Any help would be welcome. Thanks in advance.

    Posted 8 years ago #
  2. This should work, drop it into your functions.php

    // removes author information from postmeta
    function childtheme_override_postheader_postmeta() {
    
    	$postmeta = '<div class="entry-meta">';
    	$postmeta .= thematic_postmeta_entrydate();
    	$postmeta .= thematic_postmeta_editlink();
    	$postmeta .= "</div><!-- .entry-meta -->\n";
    
    	return apply_filters('thematic_postheader_postmeta',$postmeta);
    }

    First part removes the author.

    // modifies entrydate to remove "Published: " from Text also leaving just the date. The original line is below for reference to modify text.
    // $entrydate = '<span class="meta-prep meta-prep-entry-date">' . __('Published: ', 'thematic') . '</span>';
    function childtheme_override_postmeta_entrydate() {
    
    	$entrydate = '<span class="meta-prep meta-prep-entry-date">' . __('', 'thematic') . '</span>';
    	$entrydate .= '<span class="entry-date"><abbr class="published" title="';
    	$entrydate .= get_the_time(thematic_time_title()) . '">';
    	$entrydate .= get_the_time(thematic_time_display());
    	$entrydate .= '</abbr></span>';
    
    	return apply_filters('thematic_post_meta_entrydate', $entrydate);
    }

    Second part removes the "Published" from the date.

    Pretty sure you could set some CSS to display:none; also if you wanted to play with that option too, most of that info is encased in span tags.

    Posted 8 years ago #
  3. onelittlemoose
    Member

    This works perfectly. Thank you very much.

    I see I have a lot to learn about customizing Thematic. Starting with, I think, the difference between a filter and an action.

    Posted 8 years ago #
  4. @onelittlemoose, here's some info on the basics of hooks and filter:
    http://forums.themeshaper.com/topic/need-help-understanding-actions-vs-filters-and-changing-post-meta-and-utilitypost-22638

    Posted 8 years ago #
  5. Funny thing is I didn't have to do a thing. I just copied and pasted from a test site I was tinkering with when I created a little tutorial on Modifying Thematics Date Format.

    The key to getting started for me was Kathy and the themes/thematic/library/extensions folder, from that folder you can find all the guts of thematic. Once you can learn to not be terrified at looking through the php files, you can search through Google/Themeshaper.com/forums with the correct terminology which helps a bunch. ;)

    Posted 8 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.