Add prefix to specific post
-
i used this code to add prefix to specific post
function add_podcast($title) { if( in_category( 'foobar' ) ) $title = 'Podcast' . $title; return $title; } add_filter('the_title', 'add_podcast');
and i modified it to be “Updated” prefix
function add_suffix($title) { if( in_category( 'updated' ) ) $title = $title . '<span class="updated">' . 'Updated'. '</span>'; return $title; } add_filter('the_title', 'add_suffix');
but there is something went wrong
see results
https://imageshack.us/a/img832/5118/ccnplessonsonlinearabic.png
Thanks in advance ??
- The topic ‘Add prefix to specific post’ is closed to new replies.