Support Forums

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.

Peter Bockenhauer

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Peter Bockenhauer in reply to:
    Change page title for search results
    #17875

    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/

    Peter Bockenhauer in reply to:
    Change page title for search results
    #17872

    Riccardo,
    Are you using a SEO plugin that is rewriting the page title’s? That was the problem for me.

    Peter Bockenhauer in reply to:
    Change page title for search results
    #14129

    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;
    }
    }
    Peter Bockenhauer in reply to:
    Change page title for search results
    #14124

    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.

    Peter Bockenhauer in reply to:
    Change page title for search results
    #14123

    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;
    }
    }
    Peter Bockenhauer in reply to:
    Change page title for search results
    #14070

    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.

Viewing 6 posts - 1 through 6 (of 6 total)