Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Feb 2010
    Location
    Chicago
    Posts
    11
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Dynamic Sidebar not working...(Wordpress) PHP

    Hello, my single.php page on my website is currently not calling the 'Single Post' page corrently (Here) There are certain elements of the side bar missing as compared to my Home Page...

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

    Sidebar Code:
    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:
    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(); ?>
    Last edited by Rolleh; 02-23-2010 at 12:32 AM. Reason: Resolved.

  • #2
    New to the CF scene
    Join Date
    Feb 2010
    Posts
    7
    Thanks
    1
    Thanked 2 Times in 2 Posts
    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..

  • Users who have thanked nuonical for this post:

    Rolleh (02-23-2010)

  • #3
    New to the CF scene
    Join Date
    Feb 2010
    Posts
    7
    Thanks
    1
    Thanked 2 Times in 2 Posts
    PHP Code:
    <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>

  • Users who have thanked nuonical for this post:

    Rolleh (02-23-2010)

  • #4
    New Coder
    Join Date
    Feb 2010
    Location
    Chicago
    Posts
    11
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by nuonical View Post
    PHP Code:
    <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.

  • #5
    New Coder
    Join Date
    Feb 2010
    Location
    Chicago
    Posts
    11
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Nevermind, thank you Nuonical. You have resolved this issue.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •