variaas
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Remove the word *Private* on Private PagesGlad that worked for your blacloch.
@tfleming and drchrisheard – if at all possible, I avoid editing core files. In the case of upgrading, you’ll have to reapply the fix to the post.php file.
Forum: Themes and Templates
In reply to: Remove the word *Private* on Private PagesSaw a lot of posts asking the same thing with no reply. I figured it out, so here’s my solution. In my functions.php file for the template I made a small tweak to how the_title function works. Copy and paste the two functions into your functions.php file and replace all instances of the_title() with asv_the_title(). All other functionality of the_title() should still remain the same.
function asv_the_title($before = '', $after = '', $echo = true) { $title = asv_get_the_title(); if ( strlen($title) > 0 ) { $title = apply_filters('the_title', $before . $title . $after, $before, $after); if ( $echo ) echo $title; else return $title; } } function asv_get_the_title($id = 0) { $post = &get_post($id); $title = $post->post_title; return $title; }Forum: Themes and Templates
In reply to: Prevent the word “Private” in title of private postsSaw a lot of posts asking the same thing with no reply. I figured it out, so here’s my solution. In my functions.php file for the template I made a small tweak to how the_title function works. Copy and paste the two functions into your functions.php file and replace all instances of the_title() with asv_the_title(). All other functionality of the_title() should still remain the same.
function asv_the_title($before = '', $after = '', $echo = true) { $title = asv_get_the_title(); if ( strlen($title) > 0 ) { $title = apply_filters('the_title', $before . $title . $after, $before, $after); if ( $echo ) echo $title; else return $title; } } function asv_get_the_title($id = 0) { $post = &get_post($id); $title = $post->post_title; return $title; }