• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

How to add a sidebar to Woocommerce Shop Page?

phpwordpresswoocommercesidebarwoocommerce-theming


PHP Snippet 1:

if ( function_exists('register_sidebar') ) 
register_sidebar(array(
    'name' => 'Sidebar',
    'before_widget' => '<div class = "widget">',
    'after_widget' => '</div>',
    'before_title' => '<h3>',
    'after_title' => '</h3>',
    )
);

PHP Snippet 2:

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Sidebar") ) : ?>

PHP Snippet 3:

if ( is_active_sidebar( 'Sidebar' ) ) {
        dynamic_sidebar( 'Sidebar' );
}

Related Snippets

Appending data to an anchor tag

Utf8 encoding issue with Laravel

PHP Download MP3 files from directory on server

Store / Website Column in Magento 2 Admin Grid - Custom Module

PHP date() with timezone?

Multiply each value in array using array_map function

Sum column values from multiple arrays

"Mixed content blocked" when running an HTTP AJAX operation in an HTTPS page

Move a child array to parent array and change parent/child name

Minimum order amount except for specific shipping method in WooCommerce

PHP Imap , php 7.4.3 on mac osx catalina

jQuery Ajax Post with data

sqlsrv_num_rows() expects parameter 1 to be resource, boolean given

Pass a select with mysqli_fetch_row to a table

Group data in a multidimensional array based on two columns

About Contact Privacy policy Terms and conditions