I am wondering if there’s a snippet available to detect if a page’s SEO title is empty?
Something like
if(Yoast_SEO_Title_is_Empty)
<?php if(wp_title('', false)) { echo ' :'; } ?>
<?php bloginfo('name'); ?>
]]>
]]>I have been using the All in One Seo plugin for the last 10 years and want to thank you guys for creating such a useful plugin.
Well, I need to access the title that’s been overwritten by the AIOS plugin and so that I can use it instead of get_the_title()
. I want to use it to echo the following tag:
<meta itemprop="headline" content="php /*Print the title of the page here*/ echo get_aios_title();" />
But I don’t know what that function is to call for my requirement.
Please help!
]]>Happy New Year [wpdts-year years="+1"]
Thanks.
]]><title>childsRI7; play</title>
It should be like:
<title>child's play</title>
I don’t know how to fix it. Please help!
I can fix the_title()
tag with remove_filter( 'the_title', 'wptexturize' );
But it’s not working for wp_title neither add_theme_support.
wp_title
and pre_get_document_title
but I just can’t get it to work.
I’m trying to modify my post type archive template page title like this
add_filter('pre_get_document_title', 'new_filter_title');
function new_filter_title($title)
{
if ( is_page('1637') && $id = get_queried_object_id() )
{
$areas = get_query_var('area');
$area = get_term_by('slug', $areas, 'area');
$models = get_query_var('serie');
$model = get_term_by('slug', $models, 'serie');
$title = '';
if($model && $model) $title .= $model->name . ' Used';
else $title .= 'Used';
$title .= ' Cars For Sale';
if($area && $area) $title .= ' In ' . $area->name;
$title .= ' on ' . get_bloginfo('name');
return $title;
}
return $title;
}
What am I missing?
I’d like to add that, I also have an SEO plugin installed (Yoast)
]]>first of all, I love the “All in one Seo” Plugin and use it on several sites.
I have a problem on two sites: There I have double Separators in the title of Blog Posts, when “rewrite Title” is enabled. I deactivated All in One Seo and the WP Core Title showed up. The title of Blog Posts with the two separators looks like this:
“Post Title || Blog Title” (Settings: %post_title% | %blog_title%)
Here is an Example: https://www.mokan.de/ein-grill-so-gross-wie-eine-a4-seite/
On Pages everything is Ok.
Hope you can help me. Best regards!
Martin
add_filter('wpseo_title', 'vehicle_listing_title');
function vehicle_listing_title( $title )
{
if ( is_post_type_archive('vehicles') && $id = get_queried_object_id() )
{
$locations = get_query_var('location');
$location = get_term_by('slug', $locations, 'vehicle_location');
$models = get_query_var('model');
$model = get_term_by('slug', $models, 'vehicle_model');
$title = '';
if($model && $model) $title .= $model->name . ' used';
else $title .= 'Used';
$title .= ' cars for sale';
if($location && $location) $title .= ' in ' . $location->name;
$title .= ' on ' . get_bloginfo('name');
return $title;
}
return $title;
}
The code functions perfectly, but now I want to echo the exact title to show as an h1 heading in the beginning of the loop. how do I do this? I’ve tried it get_post_meta()
, I dont think its the right function for this.
add_filter('wp_title', 'vehicle_listing_title');
function vehicle_listing_title( $title )
{
if ( get_post_type() == 'vehicles' )
{
$location = get_the_terms($post->ID, 'vehicle_location');
$model = get_the_terms($post->ID, 'vehicle_model');
$title = $model . 'used cars for sale in' . $location .'on'. get_bloginfo('name');
}
return $title;
}
This code works only when there is content. but I want the code to also work when there is Nothing Found. We couldn't find what you're looking for