WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] all links broken when second sidebar is added to zen minimalist theme (3 posts)

  1. raduletzgo
    Member
    Posted 4 years ago #

    I am currently using the zen minimalist theme for my blog. This blog is using a sidebar like most blog pages do.
    I tried to add a second sidebar which worked, well almost. The second sidebar appears on my blog but problems are shifting. ;)

    As soon as I add this
    <?php include("sidebar2.php"); ?> to my index.php file all my links on the blog stop working. Everytime I click on one I get to the main page. Now I am trying to understand how this theme loads the original sidebar. Maybe this will help me somehow. I see no function like this <?php get_sidebar(); ?> in the index.php file.

    Does anyone know what's going on here?

    <?php
    get_header();
    ?>
    
    <?php include("sidebar2.php"); ?>
    
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    <?php the_date('','<h2>','</h2>'); ?>
    
    <div class="post">
    	 <h3 class="storytitle" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
    	<div class="meta"><?php _e("Filed under:"); ?> <?php the_category(',') ?> — <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__('Edit This')); ?>
    	</div><!-- end META -->
    
    	<div class="storycontent">
    		<?php the_content(__('(more...)')); ?>
    	</div><!-- end STORYCONTENT -->
    
    	<div class="feedback">
                <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
    	</div><!-- end FEEDBACK -->
    
    	<!--
    	<?php trackback_rdf(); ?>
    	-->
    
    </div><!-- end POST -->
    
    <div id="comments-post">
    <?php comments_template(); // Get wp-comments.php template ?>
    </div><!-- end COMMENTS-POST -->
    
    <?php endwhile; else: ?>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php endif; ?>
    
    <?php posts_nav_link(' — ', __('&laquo; Previous Page'), __('Next Page &raquo;')); ?>
    
    <?php get_footer(); ?>

    Since the original sidebar is not called in the index file there is no need to do it.
    I tried it anyway by adding both sidebars to the index file

    <?php include("sidebar.php"); ?>
    
    <?php include("sidebar2.php"); ?>

    I changed the functions.php as well in this case (2 sidebars instead of 1), but still no luck. Links are still broken/bad.

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    1. Look in the theme's header.php or footer.php for the call to the original sidebar.

    2. Rename sidebar2.php to sidebar-2.php and try using <?php get_sidebar('2'):?>

    http://codex.wordpress.org/Function_Reference/get_sidebar

  3. raduletzgo
    Member
    Posted 4 years ago #

    Thank you very much.
    OMG I am such an idiot. I should have looked in the footer.
    I never thought it was in the footer.

    Anyway I added this:
    <?php include("sidebar2.php"); ?>
    to the footer and it works now.

Topic Closed

This topic has been closed to new replies.

About this Topic