Forum Replies Created
-
AuthorPosts
-
3detailsMember
Brad, I said “I think” its your code because through searching I saw that your site has very similar examples (there is no author or copyright comment in my snippet…) Unless you can provide the url (which I can’t find) then I’m assuming I picked it up elsewhere, can you do that, just to clarify your accusation please?
many thanks,
Peter3detailsMemberThanks Genesis Developer, I tried this but it has not changed things
this is the current state of the code in my custom_functions.php:add_filter( 'the_title', 'text_after_title_change_color' ); function text_after_title_change_color( $title ) { global $post; if ( $post->post_title && in_category('11')) { return $title . '<span class="after-title"> - Sold</span>'; } else { return $title . ''; } }
I changed
if ( $title == $post->post_title && in_category('11')) {
toif ( $post->post_title && in_category('11')) {
because some posts in category 11 were not adding the Sold text to their titlesStill have the same problem on the backend with raw html on the post titles
3detailsMemberI can't seem to find the page but its a variation on your code no? WPsites?
I'm still looking....3detailsMembererrr maybe I spoke to soon....
This code works in my custom_functions.php however, it even applies the text on the end of post titles in the backed admin area
Worse, it reverts to raw html, e.g. "post name <span class="after-title"> - Sold</span>"I would prefer to limit the output to archive views and single post views....
3detailsMemberHey thanks for this
Using the visibility settings I am able to achieve what I was after
much appreciated!Peter
3detailsMemberthanks for looking but I just solved it!:
add_filter( 'the_title', 'text_after_title_change_color' ); function text_after_title_change_color( $title ) { global $post; if ( $title == $post->post_title && in_category('11')) { return $title . '<span class="after-title">Sold</span>'; } else { return $title . '<span class="after-title"></span>'; } }
-
AuthorPosts