Suffix post title with author nickname
-
How would I edit this code to suffix the post title with the author’s nickname (display name) AND keep the current post ID suffix as well?
Thanks Heapsadd_filter( 'the_title', 'gowp_post_id_title_suffix' ); // registers our action filter; the 2nd parameter is the name of the function we'll use to return the (possibly) updated title function gowp_post_id_title_suffix( $title ) { global $post; // get the current post object if ( ( 'job_listing' == $post->post_type ) && in_the_loop() ) { // only apply our change to Posts while in the loop $title .= " #{$post->ID}"; // append the post ID to the title } return $title; // return the title, even if we haven't modified it }
- The topic ‘Suffix post title with author nickname’ is closed to new replies.