Support » Fixing WordPress » Custom Dynamic Sidebars?

  • Resolved Amber


    So what I’m trying to do is include custom dynamic sidebars for specific pages using only the sidebar.php file

    Currently I have a page called “page-coupon.php” and I’m calling my sidebar as follows:

    <?php if(is_page()) {
    //We're on a "page", which?
    if (is_page('279')) {
    // Ah, the Coupons page!
    } else {
    // If we're not on the coupon pages
    if(!get_post_meta($post->ID, "noSidebar", true)) {

    in my functions.php i have the following to activate my widgets:

    //Activate Your Widgetized Areas
    if ( function_exists('register_sidebar' ) ) {
    $allWidgetizedAreas = array("Sidebar", "couponSidebar", "Footer1", "Footer2", "Footer3");
    foreach ($allWidgetizedAreas as $WidgetAreaName) {
    'name'=> $WidgetAreaName,
    'before_widget' => '<div id="%1$s" class="widget %2$s left half">',
    'after_widget' => '</div>',
    'before_title' => '<h3 class="widgettitle">',
    'after_title' => '</h3>',

    and I’m trying to figure out the best way to add this to my sidebar.php file. to start with I have:

    <?php if (is_page('279')) {
    if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('couponSidebar') ) : ?>
    <?php } endif; ?>
    <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar() ) ?>

    I don’t think the above is correct and I’m not 100% sure how to go about getting it to work. Currently my widget areas generate and I can place stuff into them but all the sidebars appear blank. I’ve reviewed lots of articles on custom sidebars but haven’t been able to find an answer. Can anyone offer up any assistance?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Custom Dynamic Sidebars?’ is closed to new replies.