Forums › Forums › Search & Filter Pro › How to add a string to end of every Search Results URL
- This topic has 18 replies, 4 voices, and was last updated 5 years, 6 months ago by Anonymous.
-
Anonymous(Private) April 26, 2019 at 10:39 am #209399
Ok, so maybe in different way. How to add “#promo” string to an end of every Search Results URL?
Or where is the file responsible for this? Generated url through decodeURIComponent function will solve this, but I cannot find the place where URL is generated.
Trevor(Private) April 26, 2019 at 10:43 am #209403I am not sure if this helps:
https://searchandfilter.com/documentation/action-filter-reference/#modify-urls
This post might prove useful also:
Anonymous(Private) April 26, 2019 at 11:27 am #209417I have this:
function change_sf_results_url( $url, $sfid) { //if search form ID = 225, the do something with this query if($sfid==922) { $url = add_query_arg('tab', '#promo', $url); return $url; } } add_filter( 'sf_results_url', 'change_sf_results_url', 10, 2 );
Now url looks like:
https://xxx.xxx/place/?tab=#promo&_sfm_choice=red
It should be:
‘
https://xxx.xxx/place/?_sfm_choice=red&tab=#promo
Is it possible?
Trevor(Private) April 26, 2019 at 11:32 am #209421I would have done this:
function change_sf_results_url( $url, $sfid) { //if search form ID = 225, the do something with this query if($sfid==922) { $url = add_query_arg($url, 'tab', '#promo'); return $url; } } add_filter( 'sf_results_url', 'change_sf_results_url', 10, 2 );
-
AuthorPosts