Using php to overwrite or replace title tag, while using yoast [closed]

The WPSEO plugin by Yoast has a filter for the title: ‘wpseo_title’. You’ll need to add something like this: add_filter(‘wpseo_title’, ‘filter_product_wpseo_title’); function filter_product_wpseo_title($title) { if( is_singular( ‘product’) ) { $title = //your code } return $title; } More info at the WordPress SEO API Docs page.

query_post by title?

functions.php <?php add_filter( ‘posts_where’, ‘title_like_posts_where’, 10, 2 ); function title_like_posts_where( $where, $wp_query ) { global $wpdb; if ( $post_title_like = $wp_query->get( ‘post_title_like’ ) ) { $where .= ‘ AND ‘ . $wpdb->posts . ‘.post_title LIKE \’%’ . esc_sql( $wpdb->esc_like( $post_title_like ) ) . ‘%\”; } return $where; } ?> Then: $args = array( ‘post_title_like’ => … Read more

Change “Enter Title Here” help text on a custom post type

There is no way to customize that string explicitly. But it is passed through translation function and so is easy to filter. Try something like this (don’t forget to change to your post type): add_filter(‘gettext’,’custom_enter_title’); function custom_enter_title( $input ) { global $post_type; if( is_admin() && ‘Enter title here’ == $input && ‘your_post_type’ == $post_type ) … Read more

How Do I Set the Page Title Dynamically?

There is no documentation on it but you could always apply a filter to the_title like this: add_filter(‘the_title’,’some_callback’); function some_callback($data){ global $post; // where $data would be string(#) “current title” // Example: // (you would want to change $post->ID to however you are getting the book order #, // but you can see how it … Read more