Last active
December 18, 2015 13:29
-
-
Save scottnix/5790774 to your computer and use it in GitHub Desktop.
Thematic remove Author information from postheader (override example).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.