Closed Jimmi08 closed 2 months ago
I'm sorry @Jimmi08 but I do not understand what you want to achieve or how I can help you. add_action()
is a WordPress function so, you can just handle it with the WordPress tools. If remove_action()
does not work for your needs, I have no idea how to help you.
I solved it. This is code if it is needed. Tested with Impreza theme only. Thanks for your reminder.
/* use Impreza template system */
if (!function_exists('remove_template_action'))
{
function remove_template_action()
{
global $wpsight;
remove_action('loop_start', array($wpsight->post_types, 'template_listing_single'));
remove_action('loop_end', array($wpsight->post_types, 'template_listing_single'));
remove_action('loop_start', array($wpsight->post_types, 'template_listing_archive'));
remove_action('loop_end', array($wpsight->post_types, 'template_listing_archive'));
}
}
add_action('init', 'remove_template_action');
Prerequisites
Description
I want to use wpcasa with Impreza theme. This theme has an advanced template system (based on Visual Bakery). I found that because of those actions I can not use it for a single listing template:
I tried to use remove_action() in the child theme - with init hook - but it was too soon.
Could you advise me how to do it? Maybe load it later? With init there is the error that the needed class does not exist yet.
Additional context
Thanks