• 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

Show date difference as "20" instead of "20 years ago"

How to fix this error : Ask your hosting provider to use PHP 7.2.5 or higher for both HTTP and CLI?

Explain how this array transposing and flattening function works

How to upload mpdf file after generating to s3 bucket in php

Call to undefined function openssl_decrypt

Artisan, creating tables in database

How can I convert from a{a{} b{}} to a[a[],b[]] using php preg_match?

SMTP "Error: DATA not accepted from server!" Opencart 2.3 on InMotionHosting

How to get the ID of the link in another page in php

Symfony Mercure "Failed to send an update"

Edit product hook WooCommerce

calling server using nusoap with complextype

Applying programmatically a coupon to an Order in WooCommerce3

How to use $this->session->set_userdata in codeigniter

Laravel Pagination links() not working

About Contact Privacy policy Terms and conditions