Skip to content

Instantly share code, notes, and snippets.

@scottnix
Last active December 18, 2015 13:29
Show Gist options
  • Save scottnix/5790774 to your computer and use it in GitHub Desktop.
Save scottnix/5790774 to your computer and use it in GitHub Desktop.
Thematic remove Author information from postheader (override example).
<?php
// reference http://thematictheme.com/forums/topic/making-minor-amendments-to-templates/
// reference filter example (same thing, different way to do it). I prefer the filter. https://gist.github.com/scottnix/5790774
// remove the author information from all posts using the child theme override functionality
function childtheme_override_postheader_postmeta() {
$postmeta = "\n\t\t\t\t\t";
$postmeta .= '<div class="entry-meta">' . "\n\n";
$postmeta .= "\t" . thematic_postmeta_entrydate() . "\n\n";
$postmeta .= "\t" . thematic_postmeta_editlink() . "\n\n";
$postmeta .= '</div><!-- .entry-meta -->' . "\n";
return $postmeta;
}
// remove the author information from only categories using the child theme override functionality
// this is just an example of the above, but utilizing a conditional wordpress tag
function childtheme_override_postheader_postmeta() {
if ( is_category() ) {
$postmeta = "\n\t\t\t\t\t";
$postmeta .= '<div class="entry-meta">' . "\n\n";
$postmeta .= "\t" . thematic_postmeta_entrydate() . "\n\n";
$postmeta .= "\t" . thematic_postmeta_editlink() . "\n\n";
$postmeta .= '</div><!-- .entry-meta -->' . "\n";
}
else {
$postmeta = "\n\t\t\t\t\t";
$postmeta .= '<div class="entry-meta">' . "\n\n";
$postmeta .= "\t" . thematic_postmeta_authorlink() . "\n\n";
$postmeta .= "\t" . '<span class="meta-sep meta-sep-entry-date"> | </span>'. "\n\n";
$postmeta .= "\t" . thematic_postmeta_entrydate() . "\n\n";
$postmeta .= "\t" . thematic_postmeta_editlink() . "\n\n";
$postmeta .= '</div><!-- .entry-meta -->' . "\n";
}
return $postmeta;
}
@scottnix
Copy link
Author

Override Example - https://gist.github.com/scottnix/5790774
Filter Example - https://gist.github.com/scottnix/5790772

Both do the same thing. You only need one of these functions, the second function is a example of using a conditional to achieve different results depending on your needs, the above example retains the normal functionality on everything except the categories, which are set to not show the Author Name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment