New Landing How can we help? Atelier How to change the Search Results page title

Viewing 15 posts - 1 through 15 (of 29 total)
  • Posted in: Atelier
  • #289965
    nelga
    Member
    Post count: 31

    Is there a way to change the page title for the Woocommerce search results?

    Currently it says “Search results for:” once a search is performed.

    I’ve tried some add_filter functions, but they don’t seem to do anything (see links below).

    https://bryce.se/2014/12/03/taking-control-woocommerce-titles/
    http://sarathlal.com/tweaks-on-woocommerce-page-title-using-filter-function/

    #289966
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please open to edit the sf-page-heading.php at /atelier/swift-framework/core/ , find given below of code to make the changes.

    <?php if ( $count == 1 ) : ?>
                                        <?php printf( __( '<h1>%1$s result for <span>%2$s</span></h1>', 'swiftframework' ), $count, get_search_query() ); ?>
                                    <?php else : ?>
                                        <?php printf( __( '<h1>%1$s results for <span>%2$s</span></h1>', 'swiftframework' ), $count, get_search_query() ); ?>
                                    <?php endif; ?>
    

    Thanks
    Mohammad

    #289968
    nelga
    Member
    Post count: 31

    Hi again,

    Is it possible to make this change in the child theme?

    Have just tried with a replacement sf-page-heading.php in the child theme (same folder structure), but it doesn’t seem to take effect.

    Cheers

    #289971
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Just make the change in the parent theme and copy the whole sf_page_heading function code, paste at functions.php of child theme.
    Thanks
    Mohammad

    #289972
    nelga
    Member
    Post count: 31

    Hey – just to check… you mean paste all 520 lines from the page heading function in sf-page-heading.php into the functions.php file?

    Is that excessive?

    Also – Just tried this without changing anything in the parent theme, and it didn’t seem to work. By this logic – if I make both changes and the parent theme is updated in the future, won’t this fail again? (as pasting into functions.php alone doesn’t seem to do anything)

    #289975
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Yes, there is no way beside it.
    Thanks
    Mohammad

    #289977
    nelga
    Member
    Post count: 31

    Just tried this without changing anything in the parent theme, and it didn’t seem to work. By this logic – if I make both changes and the parent theme is updated in the future, won’t this fail again? (as pasting into functions.php alone doesn’t seem to do anything)

    #289984
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Have you pasted the code of sf_page_heading function at functions.php of child theme? Did you make the changes in functions.php of child theme?
    Thanks
    Mohammad

    #289988
    nelga
    Member
    Post count: 31

    Hi again,

    That’s correct. But I’ve been testing and can’t get your solution to work unfortunately (let alone worry about future proofing). I’ve tried the following:

    – Pasting the code from sf_page_heading into the child functions.php (with modifications) – This didn’t work

    – Updating the sf_page_heading file in the parent theme by itself – This didn’t work

    – Updating both the sf_page_heading in the parent theme, and pasting everything into the child functions.php

    #289993
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please provide me login detail after installing WPIDE plugin.
    Thanks
    Mohammad

    #290692
    nelga
    Member
    Post count: 31
    This reply has been marked as private.
    #290786
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    I have managed to resolve the issue so please check it now.
    Thanks
    Mohammad

    #292356
    nelga
    Member
    Post count: 31

    Hi again,

    Sorry I was away for a few days. I’ve just checked now and the header seems to be completely missing from the ‘filter-finder’ page now.

    Are you able to please check / fix?

    Many thanks,
    Glen

    #292410
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    What do you meany by filter finder page?
    Thanks
    Mohammad

    #295046
    nelga
    Member
    Post count: 31
    This reply has been marked as private.
Viewing 15 posts - 1 through 15 (of 29 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register