Excellent Programming Tricks

Add Widgets in Woo-commerce shop page

In woocommerce.php page
<?php
                if ( is_shop() ) {
            ?>
                <div class="wc_shop_products">
                    <?php woocommerce_content(); ?>           
                </div>
                <div class="wc_shop_widgets">
                    <?php dynamic_sidebar('shop_right'); ?>
                </div>

            <?php
                }else{
                    woocommerce_content();                   
                }       
            ?>   

as usual write sidebar code in function.php
function arphabet_widgets_init() {        register_sidebar( array(
        'name'          => 'Shop Right Sidebar',
        'id'            => 'shop_right',
        'before_widget' => '<div class="double-bettery-widget-right">',
        'after_widget'  => '</div>',
        'before_title'  => '<h4 class="rounded" style="background-color:#fff">',
        'after_title'   => '</h4>',
    ) ); 
}
add_action( 'widgets_init', 'arphabet_widgets_init' ); 
   

No comments:

Post a Comment


Authentic аnd Excellent

Website

HTML Template

Wordpress Theme

Database applications

OR

Application services?

Excellent Programming Tricks (EPT) || Iftekhar-IT || We develops the Web applications and the WordPress templates. || Excellent Programming Tricks (EPT)

© 2020 Blogger Theme by Iftekhar IT || Excellent Programming Tricks

Execllent Programming Tricks. Powered by Blogger.