Code Monkey home page Code Monkey logo

Comments (5)

themesmeta avatar themesmeta commented on May 29, 2024

Same issue here, I can not get sidebar to work with specific WooCommerce "Shop base" page.
Any help would be appreciated.
Thanks in advanced !

from unyson.

player0k avatar player0k commented on May 29, 2024

Hi @pudeco,

  1. Thank you, was fixed in the v1.0.1 of Unyson-Sidebars-Extension. It is available in Unyson plugin version
  2. Was added to the filter 'fw_ext_sidebars_conditional_tags' in the last update. It can be used to add other conditional tags such as 'is_shop()'
function _filter_fw_ext_sidebars_add_conditional_tag($data) {
    $data['is_custom_shop_slug'] = array(
        'order_option' => 2,
        'check_priority' => 'first', 
        'name' => 'Shop page',
        'conditional_tag'       => array(
            'callback'              => 'is_shop',
        )
    );


    return $data;
}
add_filter('fw_ext_sidebars_conditional_tags', '_filter_fw_ext_sidebars_add_conditional_tag' );

from unyson.

player0k avatar player0k commented on May 29, 2024

@pudeco, @raynguyen
Try to create the 'sidebars-shop.php' file in the root path of theme. After than put the next code into it:

<?php
/**
 * The Shop Sidebar
 */
?>
<?php if ( function_exists('fw_ext_sidebars_get_current_position') ) : ?>
        <?php $current_position = fw_ext_sidebars_get_current_position();?>
        <?php if ($current_position !== 'full') : ?>
            <?php if ($current_position === 'left' ) : ?>
                <div>
                    <?php echo fw_ext_sidebars_show('blue'); ?>
                </div>
            <?php elseif ($current_position === 'right' ) : ?>
                <div>
                    <?php echo fw_ext_sidebars_show('blue'); ?>
                </div>
            <?php elseif ($current_position === 'left_right' ) : ?>
                <div>
                    <?php echo fw_ext_sidebars_show('blue'); ?>
                </div>
                <div>
                    <?php echo fw_ext_sidebars_show('yellow'); ?>
                </div>
            <?php endif;?>
        <?php endif;?>
<?php endif; ?>

from unyson.

themesmeta avatar themesmeta commented on May 29, 2024

Hi, @player0k,
Thanks for your hard work. But I still can not get sidebar to work with WooCommerce shop page.
I just want to have something like this in file named class-fw-extension-sidebars-frontend.php

if (is_shop()) {
            $data['type']     = $this->config->get_type_by_prefix(_FW_Extension_Sidebars_Config::POST_TYPES_PREFIX);
            $data['sub_type'] = 'page';
            $data['id']       = woocommerce_get_page_id( 'shop' );
            $result = $this->get_preset_sidebars($data);
            if ( $result )
                return $result;
        }

from unyson.

llemurya avatar llemurya commented on May 29, 2024

@raynguyen Can you see this changelog of the sidebars, I think that it can help you to solve problem with woocommerce page.If it helps please close the issue or give us a feedback.

from unyson.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.