Skip to content

Instantly share code, notes, and snippets.

@scottnix
Created June 20, 2014 05:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottnix/de50ab90cd91d29eadd5 to your computer and use it in GitHub Desktop.
Save scottnix/de50ab90cd91d29eadd5 to your computer and use it in GitHub Desktop.
Thematic Category Styling Example
// changes the "Page Title" on Categories to Blog
function childtheme_page_title($content) {
if ( is_category('') ) {
// if ( is_category('aciform') ) { // if you want to target a specific category, target it by name 'aciform'
$content = '<h1 class="page-title">';
// $content .= ' <span>' . single_cat_title('', FALSE) .'</span>'; // calls the actual category name, if you need it for something
$content .= ' <span>Blog</span>';
$content .= '</h1>' . "\n";
}
return $content;
}
add_filter('thematic_page_title', 'childtheme_page_title');
// this totally works and is good
function no_postmeta_for_cat_templates($postmeta) {
if( is_category() ) {
$postmeta='';
}
return $postmeta;
}
add_filter('thematic_postheader_postmeta', 'no_postmeta_for_cat_templates');
// this totally works and is good
function no_postfooter_for_cat_templates($postfooter) {
if( is_category() ) {
$postfooter='';
}
return $postfooter;
}
add_filter('thematic_postfooter', 'no_postfooter_for_cat_templates');
// modify the post thumbnail size though a filter, instead of a override (cleaner)
function childtheme_post_thumb_size($size) {
$size = array(480,325);
return $size;
}
add_filter('thematic_post_thumb_size', 'childtheme_post_thumb_size');
// readmore link
// add read more on categories to match wp read more, this also adds it in a second paragraph
// so they can recieve different styles
function new_excerpt_more( $more ) {
return '... </p><p><a class="more-link" href="' . get_permalink() . '">Read More</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');
/* If you need a top border, use the header for a bottom border (or background image)
/* .category .page-title {
margin-bottom: 4em;
padding-bottom: 1em;
border-bottom: 1px solid #000;
} */
.category .hentry {
clear:both;
padding-bottom: 2em;
margin-bottom: 2em;
border-bottom: 1px solid #000;
}
.category .hentry:before, .category .hentry:after {
content: " ";
display: table;
}
.category .hentry:before, .category .hentry:after {
clear: both;
}
.category .entry-header {
display: table;
float: right;
width: 45%;
margin-top: 1em; /* use this margin to push down to create a fake vertical centering */
margin-left: 5%;
margin-bottom: 1em;
border-bottom: 1px solid #000;
}
.category .entry-thumb {
float: left;
width: 50%;
}
.category .entry-thumb img {
margin: 0;
padding: 0;
}
.category .entry-content p {
display: table;
float: right;
width: 45%;
clear: right;
margin-left: 5%;
padding-bottom: 1em;
border-bottom: 1px solid #000;
}
.category .entry-content p:nth-of-type(2) {
border-bottom: none;
}
.category .entry-content .wp-post-image {
float: left;
margin: 0;
padding: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment