...

View Full Version : Resolved Dynamic Sidebar not working...(Wordpress) PHP



Rolleh
02-22-2010, 08:51 PM
Hello, my single.php page on my website is currently not calling the 'Single Post' page corrently (Here (http://www.blackoutplaylists.com/?p=74)) There are certain elements of the side bar missing as compared to my Home Page (http://www.blackoutplaylists.com)...

The code for the dynamic side is listed below as well as the code for the single post (single.php) page...

Sidebar Code:

<?php
/**
* @package WordPress
* @subpackage Default_Theme
*/
?>
<div id="sidebar">

<ul>
<?php /* Widgetized sidebar, if you have the plugin installed. */
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
<li>
<?php get_search_form(); ?>
</li>
<?php if ( is_404() || is_category() || is_day() || is_month() ||
is_year() || is_search() || is_paged() ) {
?>

<li>

<?php /* If this is a 404 page */ if (is_404()) { ?>
<?php /* If this is a category archive */ } elseif (is_category()) { ?>
<p>You are currently browsing the archives for the <?php single_cat_title(''); ?> category.</p>

<?php /* If this is a yearly archive */ } elseif (is_day()) { ?>
<p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives
for the day <?php the_time('l, F jS, Y'); ?>.</p>

<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
<p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives
for <?php the_time('F, Y'); ?>.</p>

<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
<p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives
for the year <?php the_time('Y'); ?>.</p>

<?php /* If this is a monthly archive */ } elseif (is_search()) { ?>
<p>You have searched the <a href="<?php echo bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives
for <strong>'<?php the_search_query(); ?>'</strong>. If you are unable to find anything in these search results, you can try one of these links.</p>

<?php /* If this is a monthly archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<p>You are currently browsing the <a href="<?php echo bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives.</p>
<?php } ?>


</li>

<?php } ?>

</ul>

<ul class="navigation">

<li><h2>Featured Playlists (Top 5)</h2>
<ul>

</ul>
</li>

</ul>
<ul>
<?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?>


<li><h2>Most Popular Playlists</h2>
<ul>

</ul>
</li>

<li><h2>Most Recent Playlists</h2>
<ul>
<?php wp_get_archives('type=postbypost&limit=10'); ?>
</ul>
</li>

<?php } ?>

<?php endif; ?>
</ul>
</div>

Single.php Page Code:

<?php
/**
* @package WordPress
* @subpackage Default_Theme
*/

get_header();
?>

<?php get_sidebar(); ?>

<div id="content">

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

<div class="navigation">
<div class="alignleft"><?php previous_post_link('&laquo; %link') ?></div>
<div class="alignright"><?php next_post_link('%link &raquo;') ?></div>
</div>

<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<h2><?php the_title(); ?></h2>
<div class="line"></div>
<div class="entry">
<?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>'); ?>

<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
<?php the_tags( '<p>Tags: ', ', ', '</p>'); ?>
<p class="postmetadata-single">
<small>
This entry was posted
<?php /* This is commented, because it requires a little adjusting sometimes.
You'll need to download this plugin, and follow the instructions:
http://binarybonsai.com/wordpress/time-since/ */
/* $entry_datetime = abs(strtotime($post->post_date) - (60*120)); echo time_since($entry_datetime); echo ' ago'; */ ?>
on <?php the_time('l, F jS, Y') ?> at <?php the_time() ?>
and is filed under <?php the_category(', ') ?>.
You can follow any responses to this entry through the <?php post_comments_feed_link('RSS 2.0'); ?> feed.

<?php if ( comments_open() && pings_open() ) {
// Both Comments and Pings are open ?>
You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(); ?>" rel="trackback">trackback</a> from your own site.

<?php } elseif ( !comments_open() && pings_open() ) {
// Only Pings are Open ?>
Responses are currently closed, but you can <a href="<?php trackback_url(); ?> " rel="trackback">trackback</a> from your own site.

<?php } elseif ( comments_open() && !pings_open() ) {
// Comments are open, Pings are not ?>
You can skip to the end and leave a response. Pinging is currently not allowed.

<?php } elseif ( !comments_open() && !pings_open() ) {
// Neither Comments, nor Pings are open ?>
Both comments and pings are currently closed.

<?php } edit_post_link('Edit this entry','','.'); ?>

</small>
</p>

</div>
</div>

<?php comments_template(); ?>

<?php endwhile; else: ?>

<p>Sorry, no posts matched your criteria.</p>

<?php endif; ?>

</div>


<?php get_footer(); ?>

nuonical
02-22-2010, 10:00 PM
So you're saying that your sidebar doesn't look the same on your single pages as it does on your homepage?

Just remove the "IF Homepage" statement so your sidebar and it will remain the same on every page..

nuonical
02-22-2010, 10:03 PM
<ul>



<li><h2>Most Popular Playlists</h2>
<ul>

</ul>
</li>

<li><h2>Most Recent Playlists</h2>
<ul>
<?php wp_get_archives('type=postbypost&limit=10'); ?>
</ul>
</li>


</ul>

Rolleh
02-22-2010, 11:29 PM
<ul>



<li><h2>Most Popular Playlists</h2>
<ul>

</ul>
</li>

<li><h2>Most Recent Playlists</h2>
<ul>
<?php wp_get_archives('type=postbypost&limit=10'); ?>
</ul>
</li>


</ul>


Yeah I've removed that and it still does not work properly.

Rolleh
02-22-2010, 11:32 PM
Nevermind, thank you Nuonical. You have resolved this issue. :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum