• Resolved carrieduncan

    (@carrieduncan)


    I’m attempting to make a dynamic sidebar from scratch knowing next to nothing about PHP. (Couldn’t get Sidebar Generator to work or find another compatible plugin.) There’s different content (differently styled) depending on the page:

    1. On pages About, Classes, Testimonials, and Resources, there will be a picture. (This part of the code was tested and found to work.)
    2. Pages Ask and Connect will each have a different form (that have been working fine all along).
    3. Pages based on single.php, category.php, archive.php, and search.php will have a sidebar that pretty much mimics the footer.*
    4. The Calendar page will have a calendar <?php ec3_get_calendar(); ?> in the sidebar.

    The site:
    https://www.carrieduncandesign.com/wordpress/category/investing/
    The category page template:
    https://wordpress.pastebin.ca/1770461″&gt;
    The sidebar:
    https://wordpress.pastebin.ca/1770495″&gt;

    *I removed

    <?php get_sidebar( ‘sidebar.php’ ); ?>

    from category.php (post-paste) so you can see the basic sidebar that will appear on single.php, category.php, archive.php, and search.php.

    Thanks so much for any insight you can offer.

Viewing 1 replies (of 1 total)
  • Thread Starter carrieduncan

    (@carrieduncan)

    Wish I could edit the title, mean to delete “with Sidebar Generator,” as I couldn’t get it to work.

    I ended up making a sidebar for all the pages (based on page.php) that had pictures and calling that sidebar in page.php:

    <div id="sidebar">
    <img src="https://www.carrieduncandesign.com/wordpress/wp-content/themes/LR/images/<?php
    if (is_page( 'about' )) {print 'checkbook.jpg" alt="About" />';
    }elseif (is_page( 'classes' )) {print 'class.jpg" alt="Classes" />';
    }elseif (is_page( 'testimonials' )) {print 'table.jpg" alt="Tests" />';
    }elseif (is_page( 'resources' )) {print 'resources.jpg" alt="Rescs" />';
    }else {
    print '&nbsp;';
    }
    ?>
    </div><!-- sidebar -->

    …then followed instructions in
    https://codex.www.ads-software.com/Widgetizing_Themes
    to create sidebars for the widgets the plug-ins required.

    Not so elegant, but it worked.

    All of this from a few hints on another question:
    https://www.ads-software.com/support/topic/354644?replies=7

    Thanks, esmi and blondishnet!

Viewing 1 replies (of 1 total)
  • The topic ‘Is it possible to make a conditional sidebar with Sidebar Generator?’ is closed to new replies.