Title: custom sidebar not working, need php code
Last modified: August 21, 2016

---

# custom sidebar not working, need php code

 *  Resolved [prohaus](https://wordpress.org/support/users/prohaus/)
 * (@prohaus)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/custom-sidebar-not-working-need-php-code/)
 * this plugin is not working anymore. I just need to replace dynamic_sidebar(‘main-
   sidebar’); specifically ‘main-sidebar’ so that it connects to custom sidebar.
 * And yes i have the wp-login(). Here’s the full code:
 * <div class=”box-sidebar-container”>
    <?php global $post; do_action(‘before_sidebar_hook’);
   if ($post) { if($post->post_type == ‘estate’){ dynamic_sidebar(‘estate-widget-
   area’); }else{ dynamic_sidebar(‘main-sidebar’); } }else{ dynamic_sidebar(‘main-
   sidebar’); } ?> </div>
 * [http://wordpress.org/plugins/custom-sidebars/](http://wordpress.org/plugins/custom-sidebars/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [prohaus](https://wordpress.org/support/users/prohaus/)
 * (@prohaus)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/custom-sidebar-not-working-need-php-code/#post-4493235)
 * figured it out.

Viewing 1 replies (of 1 total)

The topic ‘custom sidebar not working, need php code’ is closed to new replies.

 * ![](https://ps.w.org/custom-sidebars/assets/icon-256x256.png?rev=1414065)
 * [Custom Sidebars - Dynamic Sidebar Classic Widget Area Manager](https://wordpress.org/plugins/custom-sidebars/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-sidebars/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-sidebars/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-sidebars/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-sidebars/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-sidebars/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [prohaus](https://wordpress.org/support/users/prohaus/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/custom-sidebar-not-working-need-php-code/#post-4493235)
 * Status: resolved