the_title filter applying to menu items
Use in_the_loop() conditional tag to make sure you are modifying the title inside the Loop and to prevent the hook changing titles somewhere else: function customize_wishlist_title( $title ){ $current_user = wp_get_current_user(); $loggeduser = $current_user->user_login; // give attention to the following condition: if ( is_page( 258 ) && in_the_loop() ) { $title=”<span class=”username”>”.$loggeduser.’\’s’.'</span>’.’ ’.'<span>Wishlist</span>’; } return $title; … Read more