Forums

[resolved] Why is this not showing in my Sidebar? (6 posts)

  1. michaelborger
    Member
    Posted 1 year ago #

    Hello. This is in regard to the sidebar on HawaiiHousingNews.com. Right below "Subscribe to Our Feed via RSS" there should also be "Subscribe via EMail" but it's not showing. I can generally follow code but I'm not good with PHP or CSS syntax. Here are the only two PHP files that should be relevant (I think), subscribe.php and sidebar.php. Your help is greatly appreciated:

    subscribe.php:
    <div id="pp-subscribe" class="clearfix<?php if ($pp_feed_id) echo ' pp-email-true'; ?>" style="border-top:1px solid #ccc">
    <ul class="clearfix">
    <li id="pp-feed">
    <a>" title="Subscribe to This Feed via RSS">Subscribe <span class="email-narrow">to Our Feed</span> via RSS</a>

    <?php if ($pp_feed_id) { ?>
    <!--<li id="pp-email">
    <a href="http://feedburner.google.com/fb/a/mailverify?uri=HawaiiHousingNews&loc=en_US" title="Subscribe via Email">Subscribe via eMail</a>
    -->
    <?php } ?>

    </div>

    sidebar.php:
    <?php if (is_home()) { ?>
    <?php
    global $options;
    foreach ($options as $value) {
    if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; }
    else { $$value['id'] = get_settings( $value['id'] ); }
    } ?>
    <div id="secondary">

    <div id="pp-subscribe" class="clearfix<?php if ($pp_feed_id) echo ' pp-email-true'; ?>" style="text-align:center; padding:12px 0">
    <object width="330" height="240">
    <param name="movie" value="<?php include(TEMPLATEPATH . '/video.php'); ?>&autoplay=1"></param>
    <param name="allowFullScreen" value="true"></param>
    <param name="allowscriptaccess" value="always"></param>
    <embed src="<?php include(TEMPLATEPATH . '/video.php'); ?>&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="330" height="240" autostart="true"></embed>
    </object>
    </div>

    <?php include (TEMPLATEPATH . '/subscribe.php'); ?>

    </div><!--#secondary-->
    <?php } else {?>
    <?php
    global $options;
    foreach ($options as $value) {
    if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; }
    else { $$value['id'] = get_settings( $value['id'] ); }
    } ?>
    <div id="secondary">

    <?php } ?>

  2. michaelborger
    Member
    Posted 1 year ago #

    On a separate yet related note, this is a custom theme I'm using. If I drop widgets into the Theme Editor in the admin panel, they do not appear. From my limited assessment, it seems to me that there's no place in this sidebar code to allow for widgets to 'come and go', i.e. it's hard-coded instead. Is this right? I'd like to get my "Subscribe via Email" link to work, but I'd also like the flexibility going forward to add other widgets to my sidebar if I choose so I can allow the site to expand as needed.

  3. alchymyth
    The Sweeper
    Posted 1 year ago #

    everything between <!-- and --> is considered to be a comment in html and is not displayed onto the screen;

    remove these from your code, so you end up with:

    <?php if ($pp_feed_id) { ?>
    <li id="pp-email">
    <a href="http://feedburner.google.com/fb/a/mailverify?uri=HawaiiHousingNews&loc=en_US" title="Subscribe via Email">Subscribe via eMail</a>
    
    <?php } ?>
  4. michaelborger
    Member
    Posted 1 year ago #

    Thanks for the quick reply. Unfortunately that didn't seem to change anything. My sidebar.php is still the same as above. My subscribe.php is now, per your instructions:

    <div id="pp-subscribe" class="clearfix<?php if ($pp_feed_id) echo ' pp-email-true'; ?>" style="border-top:1px solid #ccc">
    <ul class="clearfix">
    <li id="pp-feed">
    <a target="_blank" href="<?php if ($pp_feed_address) {echo $pp_feed_address;} else {bloginfo('rss2_url');} ?>" title="Subscribe to This Feed via RSS">Subscribe <span class="email-narrow">to Our Feed</span> via RSS</a>

    <?php if ($pp_feed_id) { ?>
    <li id="pp-email">
    <a target="_blank" href="http://feedburner.google.com/fb/a/mailverify?uri=HawaiiHousingNews&loc=en_US" title="Subscribe via Email" >Subscribe via eMail</a>

    <?php } ?>

    </div>

  5. alchymyth
    The Sweeper
    Posted 1 year ago #

    the email stuff also depends on a variable:

    <?php if ($pp_feed_id) { ?>

    this points to some option setting in the dashboard which might not have been filled in.

    if you want to make it independant of the variable, you could delete the lines
    <?php if ($pp_feed_id) { ?>
    and
    <?php } ?>
    from subscribe.php

  6. michaelborger
    Member
    Posted 1 year ago #

    Great - it works! Thanks so much.

Topic Closed

This topic has been closed to new replies.

About this Topic