How come my first blog post and my home page have the same title?

The “Reading Settings” at a domain’s wp-admin/options-reading.php is, by default, set to latest posts. So, WordPress, by default, would show the title of the post being set at “General Settings” at a domain’s wp-admin/options-general.php . In this case, Yoast’s WordPress SEO plugin would have form fields to customize it. When the “Reading Settings” are changed … Read more

Multiple Conditions for Child Page Title

Based on the comment exchange, here’s what I think you’re after: <h1><?php echo get_the_title( $post->post_parent ? $post->post_parent : $post->ID ) ?></h1> <?php if ( $list = wp_list_pages( “echo=0&child_of=$post->ID” ) ) : ?> <h2>Select a sub-page</h2> <ul> <?php echo $list ?> </ul> <?php elseif ( $post->parent ) : ?> <h2><?php the_title() ?></h2> <?php endif ?>

What code do you use to generate the text to go into the HTML title tag?

Mine is: function getDocumentTitle($separator = ” &laquo; “){ $title = get_bloginfo(‘name’); $desc = get_bloginfo(‘description’); if(is_front_page() && is_home() && !empty($desc)){ $title .= $separator.$desc; }elseif(is_home() || is_singular()){ $id = $GLOBALS[‘wp_query’]->get_queried_object_id(); if($meta = get_post_meta($id, ‘title’, true)) $title .= $separator.$meta; $title .= (empty($meta) && is_front_page() && !empty($desc)) ? $separator.$desc : $separator.get_post_field(‘post_title’, $id); }elseif(is_archive()){ if(is_category() || is_tag() || is_tax()){ $term … Read more

Remove site name from tag

The best (and easiest) thing to do is to use the wp_title filter. First, clean up your call to <?php wp_title(); ?> in your template. Replace what you have with this: wp_title( ‘&#124;’, true, ‘right’ ); Then, in functions.php (or in a child Theme functions.php; normal caveats apply), add the following: function wpse95147_filter_wp_title( $title ) … Read more

Site title not showing. What can I do?

Add this code to your functions.php if ( !function_exists( ‘yourtheme_setup’ ) ) { function yourtheme_setup() { /* * Let WordPress manage the document title. * By adding theme support, we declare that this theme does not use a * hard-coded <title> tag in the document head, and expect WordPress to * provide it for us. … Read more

Custom Post Type Title Placeholder [duplicate]

Yes sure you can achive that simply using enter_title_here filter hook. add_filter(‘enter_title_here’, ‘my_title_place_holder’ , 20 , 2 ); function my_title_place_holder($title , $post){ if( $post->post_type == ‘portfolio’ ){ $my_title = “Add new Portfolio”; return $my_title; } return $title; }

How can i remove JUST the title tag from wp_head() function?

You can see everything added to wp_head in the file /wp-includes/default-filters.php. If your theme supports the title tag, you can remove it entirely with remove_action: remove_action( ‘wp_head’, ‘_wp_render_title_tag’, 1 ); Though it may be simpler/better to use remove_theme_support( ‘title-tag’ ) in a child theme, which is what _wp_render_title_tag checks before outputting the title tag.

Automatically add title attribute to links in WordPress

Don’t know if this works but it should, function get_page_title($url){ if( !class_exists( ‘WP_Http’ ) ) include_once( ABSPATH . WPINC. ‘/class-http.php’ ); $request = new WP_Http; $result = $request->request( $url ); if( is_wp_error( $result ) ) return false; if( preg_match(“#<title>(.+)<\/title>#iU”, $result, $t)) { return trim($t[1]); } else { return false; } } add_filter(‘the_content’,’auto_add_title_to_link’); function auto_add_title_to_link($content){ $html … Read more