Home › Forums › Support › How do I manipulate the page titles? This topic has 5 replies, 2 voices, and was last updated 4 years, 6 months ago by Pete. Viewing 6 posts - 1 through 6 (of 6 total) Author Posts April 19, 2016 at 5:54 am #187890 Pete How do I manipulate the header page titles? (the one in the browser tab, not the edit screen) I don’t want to install any plugins to change it. April 19, 2016 at 9:27 am #187933 TomLead Developer Lead Developer It’s way easier to just use a plugin, but this might help: http://wordpress.stackexchange.com/questions/176940/add-theme-support-title-tag-in-conflict-with-custom-titles-function April 23, 2016 at 12:21 am #188733 Pete Where about is the code that sets the titles? I’m asking as I really need to set some powerful conditionals as as my titles This reply was modified 7 years, 1 month ago by Pete. April 23, 2016 at 12:29 am #188737 Pete or how could I edit this snippet so that I can free add some wp template tags <?php add_action( ‘after_setup_theme’, ‘theme_functions’ ); function theme_functions() { add_theme_support( ‘title-tag’ ); } add_filter( ‘wp_title’, ‘custom_titles’, 10, 2 ); function custom_titles( $title, $sep ) { //Check if custom titles are enabled from your option framework if ( ot_get_option( ‘enable_custom_titles’ ) === ‘on’ ) { ?> //Something like <?php if( is_sticky()) { ?> // <?php } else { ?> // <?php } ?> $title = “Some other title” . $title;; <?php } return $title; } ?> This reply was modified 7 years, 1 month ago by Pete. April 23, 2016 at 7:53 am #188803 TomLead Developer Lead Developer This is already done in GP: add_theme_support( 'title-tag' ); You’re on the right track with the wp_title filter – you just need to use the right conditionals and then return the titles. You might get some more in depth answers over on http://wordpress.stackexchange.com. November 24, 2018 at 4:53 am #737267 Pete resolved Author Posts Viewing 6 posts - 1 through 6 (of 6 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In