Sidebar question..
-
Hi all.
I think the answer is simple, but I’m not super savvy with code-changing solutions (I’m good at trying anyway).
This theme is allowing me to change widgets for a sidebar, but only for individual posts. I would like the sidebar to be the exact same for my main page but it’s just blank.
How do I get my sidebar to stay the same whether or not a person is on the first page or in a single post?
Thank you!
-
I am not sure which theme you are using but I’m assuming it has code to display different sidebars depending upon which area of the site you are viewing.
You’ll have to go into your sidebar.php file most likely and look to see if there are any signs of similar following code…
if (is_archive()) { Stuff goes here } else { Other stuff goes here }The above code states that if a visitor is on the archive page then display the text “Stuff goes here” but if they are on any other page on the site than display the text “Other stuff goes here”.
Can you post your sidebar.php file for us here or the name of the theme you are using?
Thanks for the help,
I am using Piano Black
In my editor, I also see options for:
# No sidebar Page Template (page-noside.php) # No sidebar, No comment Page Template (page-noside-nocomment.php).. not sure if that has anything to do with what I’m looking to accomplish.
My sidebar.php is:
<div id="right-col"> <?php $options = get_option('pb_options'); ?> <?php if ($options['show_information']) : ?> <h3 class="side-title" id="information-title"><?php if($options['information_title']) { echo ($options['information_title']); } else { _e('INFORMATION','piano-black'); } ?></h3> <div class="information-contents"> <?php if($options['information_contents']) { echo ($options['information_contents']); } else { _e('Change this sentence and title from admin Theme option page.','piano-black'); } ?> </div> <?php endif; ?> <?php if(is_active_sidebar('top')||is_active_sidebar('bottom')||is_active_sidebar('left')||is_active_sidebar('right')){ ?> <div id="side-top"> <?php dynamic_sidebar('top'); ?> </div> <div id="side_middle" class="clearfix"> <div id="side-left"> <?php dynamic_sidebar('left'); ?> </div> <div id="side-right"> <?php dynamic_sidebar('right'); ?> </div> </div> <div id="side-bottom"> <?php dynamic_sidebar('bottom'); ?> </div> <?php } else { ?> <div id="side-top"> <div class="side-box"> <h3 class="side-title"><?php _e('RECENT ENTRY','piano-black'); ?></h3> <ul> <?php $myposts = get_posts('numberposts=5'); foreach($myposts as $post) : ?> <li><a>"><?php the_title(); ?></a></li> <?php endforeach; ?> </ul> </div> </div> <div id="side_middle" class="clearfix"> <div id="side-left-ex"> <div class="side-box-short"> <h3 class="side-title"><?php _e('CATEGORY','piano-black'); ?></h3> <ul> <?php wp_list_cats('sort_column=name'); ?> </ul> </div> </div> <div id="side-right-ex"> <div class="side-box-short"> <h3 class="side-title"><?php _e('ARCHIVES','piano-black'); ?></h3> <ul> <?php wp_get_archives('type=monthly'); ?> </ul> </div> </div> </div> <div id="side-bottom-ex"> <div class="side-box"> <h3 class="side-title"><?php _e('LINKS','piano-black'); ?></h3> <ul> <?php wp_list_bookmarks('title_li=&categorize=0'); ?> </ul> </div> </div> <?php }; ?> <div class="side-box"> <ul id="copyrights"> <li> <?php global $wpdb; $post_datetimes = $wpdb->get_row($wpdb->prepare("SELECT YEAR(min(post_date_gmt)) AS firstyear, YEAR(max(post_date_gmt)) AS lastyear FROM $wpdb->posts WHERE post_date_gmt > 1970")); if ($post_datetimes) { $firstpost_year = $post_datetimes->firstyear; $lastpost_year = $post_datetimes->lastyear; $copyright = __('Copyright © ', 'piano-black') . $firstpost_year; if($firstpost_year != $lastpost_year) { $copyright .= '-'. $lastpost_year; } $copyright .= ' '; echo $copyright; } ?> <a>/"><?php bloginfo('name'); ?></a></li> </div> </div><!-- #left-col end -->Are you using the default front page with WP or did you set a custom front page using a Page in WP?
I downloaded the theme onto my local test server and added the Calendar widget under the top section for the sidebar and the calendar displays on the main page of the theme as well as single posts and pages.
I am using the default front page. All I did was download the theme and attempt to make some small changes.
Anything I put in the sidebar from the widgets panel, shows up if I clicked on each individual post. On the main/front page, those same widgets show up but they’re on the very bottom of the page, and there isn’t anything on the sidebar.
thank you again for your help 🙂
Did these small changes you made have anything to do with any code?
nope.
The topic ‘Sidebar question..’ is closed to new replies.