Change Suggested Phrases conditionally
PreviousIndex Table – Indexing ACF repeater field titles and contentsNextHow to add shortcode to the results content?
Last updated
Last updated
The plugin provides a filter for developers to apply changes to the Suggested Phrases (beneath the search bar) on certain conditions.
You can put the function you need from below in your active themes directory into the functions.php file ( wp-content/themes/{your_theme}/functions.php )
This code will allow displaying alternative keywords if the post ID is within an array of specified post IDs.
Change the $cpt_array variable to the post/page IDs where you want to display the alternative keywords.
Change the $alt_phrases variable to the keywords you want to display.
Change the $allow_home variable true if one of the page IDs you allowed is used as the home page.