Forums Forums Search & Filter Pro Archive results – Update Page Title problem

Viewing 10 posts - 1 through 10 (of 13 total)
  • Anonymous
    #44759

    Hello ๐Ÿ™‚

    I have my results page set-up to show as an archive and it uses my archive.php template.

    It in turn by default shows the Page Title of the first post in the loop, so I added the code below to my functions.php file as per the documentation

    add_filter('wp_title','search_form_title');
    
    function search_form_title($title){ 
    	global $searchandfilter;
    
    	if ( $searchandfilter->active_sfid() == 1242) {
    		return 'Know-how Filter search results';
    	} else {
    		return $title;
    	} 
    
    }

    My form is [searchandfilter id=”1242″] so 1242 should be right?

    Any ideas why this isn’t working :).

    Many thanks,
    TJ

    Anonymous
    #44760
    This reply has been marked as private.
    Trevor
    #44785

    The filter you show affects the results page, but the URL you give has no results form on it, maybe?

    Anonymous
    #44787

    Hi Trevor,

    Many thanks for getting back, sadly not sure I’m fully understanding. So that link I gave shows the results, and the form is revealed when you click the “FILTER” link which basically feeds the results into that same page, but even when it’s displaying results, the page title isn’t changing.

    The page is powered by my standard archive.php template, and I within the S&F settings I set the page to have the following slug /know-how-filter/ as you can see, but it’s not a “real” page, so I thought that code was the way to override the archive title with an appropriate results title?

    Many thanks,
    TJ

    Trevor
    #44788

    The page I see has a yellow search by keyword box in the middle, yes? That is a Search and Filter FORM. The code you used only works on a search results page that the form sends to. Did you try make a page in WP with that same slug and set a title to it?

    Anonymous
    #44792

    No, that is a different separate form, the Search and Filter FORM is revealed if you click the yellow “FILTER” link button. Can you see where I mean? ๐Ÿ™‚

    Trevor
    #44793

    Ah, I had to scroll down the page and suddenly that appeared. The results are on the same page? So, did you try what I said? Make a page in WordPress with the Title you want make make the slug for that page the same as this search page?

    Anonymous
    #44806

    Ah yep, sorry for the confusion :). Sadly yes tried what you said and created a page with that slug, but didn’t change anything sadly, I suppose because it is set to display as an archive it’s working off of the archive functionality. And that’s what I thought the Update Page Title filter was for as it made complete sense.

    Trevor
    #44818

    I will need to discuss this with Ross.

    Ross Moderator
    #45433

    Are you using yoast by any chance? or another plugin which could affect titles?

    For yoast, I think the filter is wpseo_title or seo_title ๐Ÿ™‚

    Also please double check the ID of your search form, when importing / exporting IDs get changes :/

    Thanks

Viewing 10 posts - 1 through 10 (of 13 total)