when you make a post, at the bottom of it says something like this:
"posted in category "x", "y" and tagges "1", "2". Post a comment. Trackback"
What if I only wanted to displays the category/tag links? and remove the regular text.
when you make a post, at the bottom of it says something like this:
"posted in category "x", "y" and tagges "1", "2". Post a comment. Trackback"
What if I only wanted to displays the category/tag links? and remove the regular text.
I have been editing that info for my own theme myself. Here's what I have so far.
First, we need to remove the comments/trackback text. Copy this into your functions.php
// edit Information in Post Footer
function childtheme_postfooter() {
global $id, $post;
if ($post->post_type == 'page' && current_user_can('edit_posts')) { /* For logged-in "page" search results */
$postfooter = '<div class="entry-utility">' . thematic_postfooter_posteditlink();
$postfooter .= "</div><!-- .entry-utility -->\n";
} elseif ($post->post_type == 'page') { /* For logged-out "page" search results */
$postfooter = '';
} else {
if (is_single()) {
$postfooter = '<div class="entry-utility">' . thematic_postfooter_postcategory() . thematic_postfooter_posttags();
} else {
$postfooter = '<div class="entry-utility">' . thematic_postfooter_postcategory() . thematic_postfooter_posttags();
}
$postfooter .= "</div><!-- .entry-utility -->\n";
}
// Put it on the screen
echo apply_filters( 'childtheme_postfooter', $postfooter ); // Filter to override default post footer
} // end thematic_postfooter
add_filter('thematic_postfooter','childtheme_postfooter');
Most of that is straight from the thematic files, I just edited it to not call for the comments & trackbacks.
Now we change the look of the catagories, to remove the text:
// edit post category
function childtheme_postfooter_postcategory() {
$postcategory = '<span class="cat-links">';
if (is_single()) {
$postcategory .= __('Catagories: ', 'thematic') . get_the_category_list(', ');
$postcategory .= '</span>';
} elseif ( is_category() && $cats_meow = thematic_cats_meow(', ') ) { /* Returns categories other than the one queried */
$postcategory .= __('&', 'thematic') . $cats_meow;
$postcategory .= '</span> <span class="meta-sep meta-sep-tag-links">|</span>';
} else {
$postcategory .= __('Posted in ', 'thematic') . get_the_category_list(', ');
$postcategory .= '</span> <span class="meta-sep meta-sep-tag-links">|</span>';
}
return apply_filters('childtheme_postfooter_postcategory',$postcategory);
} // end thematic_postfooter_postcategory
add_filter('thematic_postfooter_postcategory','childtheme_postfooter_postcategory');
Same deal, that is code from thematic that I edited to change the text it shows.
Lastly, change the text for the tags:
// edit post tags
function childtheme_postfooter_posttags() {
if (is_single()) {
$tagtext = __(' | Tags:', 'thematic');
$posttags = get_the_tag_list("<span class=\"tag-links\"> $tagtext ",', ','</span>');
} elseif ( is_tag() && $tag_ur_it = thematic_tag_ur_it(', ') ) { /* Returns tags other than the one queried */
$posttags = '<span class="tag-links">' . __(' Also tagged ', 'thematic') . $tag_ur_it . '</span> <span class="meta-sep meta-sep-comments-link">|</span>';
} else {
$tagtext = __('Tagged', 'thematic');
$posttags = get_the_tag_list("<span class=\"tag-links\"> $tagtext ",', ','</span> <span class="meta-sep meta-sep-comments-link">|</span>');
}
return apply_filters('childtheme_postfooter_posttags',$posttags);
} // end thematic_postfooter_posttags
add_filter('thematic_postfooter_posttags','childtheme_postfooter_posttags');
Hope this helps you!
Newbie
Thanks! I'm going to see if I can get it working right now
Hmmm, not sure if it's working. I still see al the test.
Here is a screenshot of what I'm referring to:
http://jeffsimpsonphoto.com/public/postmetahelp.jpg
I'd like it to only say the categories, 'permalink', 'post comment' just links.. no regular text
i think those are the default functions inside the filters... you will need to change/remove the text you don't want to appear.
any time you see something like:
__('Posted in ', 'thematic')
that Posted in text is going to appear. i think it is written like that for translation purposes... so if you want to get rid of the Posted in, you'd need
__('', 'thematic') or better still just delete it entirely.
I tried removing all the text in 'content-extensions' and it still shows up. I did a keyword search in all the stock wordpress files and didn't find anything. This is driving me insane heh
you should not be removing anything in 'content-extensions' and definitely not in the wordpress files. you need to use the filters from above, put them in your child's functions.php and then edit there. for instance add this to your functions.php and it should get rid of Tags/tagged stuff on the homepage and all pages except the tag pages. i didn't change anything there, but you certainly could. the category situation is very similar.
// edit post tags
function childtheme_postfooter_posttags($posttags) {
if (is_single()) {
$tagtext = '';
$posttags = get_the_tag_list("<span class=\"tag-links\"> $tagtext ",', ','</span>');
} elseif ( is_tag() && $tag_ur_it = thematic_tag_ur_it(', ') ) { /* Returns tags other than the one queried */
$posttags = '<span class="tag-links">' . __(' Also tagged ', 'thematic') . $tag_ur_it . '</span> <span class="meta-sep meta-sep-comments-link">|</span>';
} else {
$tagtext = '';
$posttags = get_the_tag_list("<span class=\"tag-links\"> $tagtext ",', ','</span> <span class="meta-sep meta-sep-comments-link">|</span>');
}
return $posttags;
} //
add_filter('thematic_postfooter_posttags','childtheme_postfooter_posttags');
This topic has been closed to new replies.