Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello ibogo.
    Try replacing the old code with this one:

    add_action('after_setup_theme', 'wp_deals_comp', 50);
    function wp_deals_comp(){
      if ( ! ( method_exists('TC_plugins_compat', 'tc_is_plugin_active')
                  && method_exists('TC_plugins_compat', 'tc_mainwrapper_start')
                  && method_exists('TC_plugins_compat', 'tc_mainwrapper_end') ) )
       return;             
    
      if ( !  TC_plugins_compat::$instance -> tc_is_plugin_active('wp-deals/wpdeals.php') )
            return;
    
      // unhook wp deals wrapper
      remove_action('wpdeals_before_main_content', 'wpdeals_output_content_wrapper', 10 );
      remove_action('wpdeals_after_main_content', 'wpdeals_output_content_wrapper_end', 10 );
    
      // hook customizr wrapper and action hooks
      add_action('wpdeals_before_main_content', array( TC_plugins_compat::$instance, 'tc_mainwrapper_start') );
      add_action('wpdeals_after_main_content', array( TC_plugins_compat::$instance, 'tc_mainwrapper_end') );
    
      //handles the wpdeals sidebar: removes action if sidebars not active
      if ( ! is_active_sidebar( 'deals' ) ) {
        remove_action( 'wpdeals_sidebar', 'wpdeals_get_sidebar', 10 );
      }
    
      //disables post navigation
      add_filter( 'tc_show_post_navigation', 'tc_wpdeals_disable_post_navigation' );
      function tc_wpdeals_disable_post_navigation($bool) {
        return ( function_exists('is_wpdeals') && is_wpdeals() ) ? false : $bool;
      }
    
      //removes post comment action on after_loop hook
      add_filter( 'tc_are_comments_enabled', 'tc_wpdeals_disable_comments' );
      function tc_wpdeals_disable_comments($bool) {
        return ( function_exists('is_wpdeals') && is_wpdeals() ) ? false : $bool;
      }
    }

    hope this helps.

    Thread Starter ibogo

    (@ibogo)

    Not working in child themefunctions.php

    I noticed the example URL contains “/blog”

    Apparently I did not install in base directory.

    We are looking to fix pages not blog posts.

    Does it work for you in test?

    Thread Starter ibogo

    (@ibogo)

    Basically it is not working in functions.php, and I don’t know why :s

    Yes it works here
    I don’t understand the “example url”.. what’s this example url?

    Ah I see, I used the first code (for wp deals), I should use the second (which is for deals-engine).
    So:

    add_action('after_setup_theme', 'wps_deals_comp', 50);
    function wps_deals_comp(){
      if ( ! ( method_exists('TC_plugins_compat', 'tc_is_plugin_active')
                  && method_exists('TC_plugins_compat', 'tc_mainwrapper_start')
                  && method_exists('TC_plugins_compat', 'tc_mainwrapper_end') ) )
       return;             
    
      if ( !  TC_plugins_compat::$instance -> tc_is_plugin_active('deals-engine/deals-engine.php') )
            return;
    
      // unhook wp deals wrapper
      remove_action('wps_deals_before_main_content', 'wps_deals_output_content_wrapper', 10 );
      remove_action('wps_deals_after_main_content', 'wps_deals_output_content_wrapper_end', 10 );
    
      // hook customizr wrapper and action hooks
      add_action('wps_deals_before_main_content', array( TC_plugins_compat::$instance, 'tc_mainwrapper_start') );
      add_action('wps_deals_after_main_content', array( TC_plugins_compat::$instance, 'tc_mainwrapper_end') );
    
      //handles the wpdeals sidebar: removes action if sidebars not active
      if ( ! is_active_sidebar( 'deals' ) ) {
        remove_action( 'wps_deals_sidebar', 'wps_deals_get_sidebar', 10 );
      }
    
      //disables post navigation
      add_filter( 'tc_show_post_navigation', 'tc_wpsdeals_disable_post_navigation' );
      function tc_wpsdeals_disable_post_navigation($bool) {
        return ( is_single() && get_post_type() == WPS_DEALS_POST_TYPE ) ? false : $bool;
      }
    
      //removes post comment action on after_loop hook
      add_filter( 'tc_are_comments_enabled', 'tc_wpsdeals_disable_comments' );
      function tc_wpsdeals_disable_comments($bool) {
        return ( is_single() && get_post_type() == WPS_DEALS_POST_TYPE ) ? false : $bool;
      }
    
      //hide tax title
      add_filter( 'tc_show_tax_archive_title', 'tc_wpsdeals_disable_tax_archive_title');
      function tc_bbpress_disable_tax_archive_title( $bool ){
        return ( get_post_type() == WPS_DEALS_POST_TYPE ) ? false : $bool;
      }
    }

    Thread Starter ibogo

    (@ibogo)

    Thank you ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Plugin not supported by Customizr’ is closed to new replies.