Forums › Forums › Search & Filter Pro › Align fields and make them non-bullet points and remove Related Post content
- This topic has 27 replies, 2 voices, and was last updated 4 years, 1 month ago by Trevor.
-
Anonymous(Private) October 12, 2020 at 2:27 pm #262713
That fixed it, thanks Trevor!
Now the only remaining issue is the repeated Related Post content and the speed issue that is, hopefully, related to this.
Related Post Plugin page: https://pickplugins.com/item/related-post-for-wordpress/.
There is some information on the plugin developer’s site on how to disable the Related Post content on a particular page but I can’t get that to work, perhaps this may help you: https://pickplugins.com/documentation/related-post/action-hook/related_post_main/
Trevor(Private) October 12, 2020 at 2:59 pm #262719In the child theme functions.php file:
add_action('related_post_main','related_post_main_remove_hook_sandf', 0); function related_post_main_remove_hook_sandf() { if (is_page(25640)) { remove_action('related_post_main','related_post_main_title'); remove_action('related_post_main','related_post_main_post_loop'); remove_action('related_post_main','related_post_main_css'); remove_action('related_post_main','related_post_main_slider_scripts'); } }
I think that would do it.
Trevor(Private) October 12, 2020 at 3:46 pm #262728Try this (not sure this will work):
add_action('related_post_main','related_post_main_remove_hook_sandf', 0); function related_post_main_remove_hook_sandf() { global $searchandfilter; $sf_current_query = $searchandfilter->get(25639)->current_query(); if ($sf_current_query->is_filtered())||($sf_current_query->get_search_term()<>"")||is_page(25640)) { remove_action('related_post_main','related_post_main_title'); remove_action('related_post_main','related_post_main_post_loop'); remove_action('related_post_main','related_post_main_css'); remove_action('related_post_main','related_post_main_slider_scripts'); } }
Anonymous(Private) October 12, 2020 at 4:09 pm #262732Alas, that results in a Syntax Error, preventing the code to be added:
“Your PHP code changes were rolled back due to an error on line 1082 of file wp-content/themes/theblog/functions.php. Please fix and try saving again.”
syntax error, unexpected ‘||’ (T_BOOLEAN_OR)
FYI: line 1082 holds the following line of your code: if ($sf_current_query->is_filtered())||($sf_current_query->get_search_term()<>””)||is_page(25640)) {
-
AuthorPosts