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, 11 months ago by
Trevor.
-
Trevor(Private) October 12, 2020 at 2:59 pm #262719
In 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