• 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

HTML + PHP + PHPMAILER

Laravel PackageManifest.php: Undefined index: name

Show Custom Data in Woocommerce Order Details Admin Area

Laravel set default language not working

How to show a popup modal in codeIgniter?

Converting IPv6 to IPv4 address in PHP

How to convert binary string to normal string in php

Using spatie/media-library, how to rename a collection of uploaded files?

OctoberCMS / Anonymous Global Scope

enroll_table three field fetch to payment form to create payment field in laravel 5.5

Change user role if checkout custom checkbox is checked in WooCommerce

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given [duplicate]

Insert And Retrieve Data in MySQL with $.post Noob Question

how to retrieve the first and last instance of a row in pdo dataset

wp_remote_get() not passing authentication

About Contact Privacy policy Terms and conditions