The forums are closed and will be removed when we launch our new site.
Looking for support? You can access the support system via your account.
The forums are closed and will be removed when we launch our new site.
Looking for support? You can access the support system via your account.
There should be a “rewrite titles” checkbox to disable. I’m guessing in order to rewrite the titles with this setup you would have to manually do it: https://perishablepress.com/how-to-generate-perfect-wordpress-title-tags-without-a-plugin/
Riccardo,
Are you using a SEO plugin that is rewriting the page title’s? That was the problem for me.
Thanks, that worked!
Here’s the final code in my functions.php for anyone else that needs it. I am using two search forms in this example.
add_filter('wp_title','search_meta_title');
function search_meta_title($data){
global $sf_form_data;
if($sf_form_data->form_id()==141)
{
return 'Restaurants';
}
if($sf_form_data->form_id()==169)
{
return 'Hotels';
}
else
{
return $data;
}
}
Follow-up. Looks like I can continue to use All-in-one SEO Pack if I just disable “Rewrite titles”. I will just manually edit my theme’s title tag to how I want but still retain the other features of this SEO plugin.
I’m still curious how I would be able to display a different title based on custom post type.
Thanks. I have to disable my SEO plugin (All-in-One SEO Pack) in order for this to work as well. Is this the only way around this?
After I put this code into my functions.php it displays in the title fine. However, I plan on adding multiple custom post types. Would I be able to target the different post types and display different titles for each?
add_filter('wp_title','search_meta_title');
function search_meta_title($data){
global $sf_form_data;
if ( $sf_form_data->is_valid_form() )
{
return 'Product Search Results';
}
else
{
return $data;
}
}
I have a somewhat similar problem. The page title for mine is displaying the name of the first post title (custom post type) on the page. I am using AJAX and the archive page.
© 2024 Search & Filter Support. All Rights Reserved.
This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
We also use cookies to store items in your cart as well as allowing your to login on the site.
You can adjust all of your cookie settings by navigating the tabs on the left hand side.
By continuing to use this site, you also agree to our Privacy Policy.
Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.
*Other cookies used for logging in and cart functions will only be used when you use those features and cannot be disabled.
If you disable these cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.
This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.
Keeping this cookie enabled helps us to improve our website.
Please enable Strictly Necessary Cookies first so that we can save your preferences!
More information about our Cookie Policy