WordPress.org

Ready to get started?Download WordPress

Forums

How do I change sidebar order? (7 posts)

  1. adamcorley.com
    Member
    Posted 4 years ago #

    I have messed around with my index.php file and some other files and can't figure it out.

    I want to change the order the sidebar-content-sidebar

  2. MichaelH
    Member
    Posted 4 years ago #

    Either drag and drop the widgets into a different order, or with most themes, change the order of the Templates Tags.

    For instance with the WordPress Default theme you would edit wp-content/themes/default/sidebar.php and rearrange this code that lists pages, archives, and categories.

    <ul role="navigation">
    			<?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?>
    
    			<li><h2>Archives</h2>
    				<ul>
    				<?php wp_get_archives('type=monthly'); ?>
    				</ul>
    			</li>
    
    			<?php wp_list_categories('show_count=1&title_li=<h2>Categories</h2>'); ?>
    		</ul>

    Related:
    Stepping Into Template Tags
    Stepping Into Templates
    Template Hierarchy

  3. adamcorley.com
    Member
    Posted 4 years ago #

    Hi Michael. My theme isn't most themes. It's a quite complicated framework. Here is whats in my index.php:

    <?php get_header(); ?>
    <!-- Begin #main -->
    <div id="main">
    
    <!-- Begin .post -->
    <?php $found=0; ?>
    
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <?php if (in_category(0) && !$single) { $found=1; ?>
    
    <?php } else { ?>
    
      <div class="post"><br /><br />
      <div class="post-title"><a href="<?php the_permalink() ?>" style="text-decoration:none;" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"> <?php the_title(); ?></a>
        </div>
    <div class="post-entryinfo"><small>By <?php the_author_posts_link(); ?> | <?php the_time('F j, Y',display); ?> | Filed in: <?php the_category(',') ?></small></div>
    
    	         <div class="post-body">
    	<div>
            <?php if($post->post_excerpt) { ?>
                     <div class="post-excerpt"><?php the_excerpt(); ?></div>
            <?php } ?>
          <?php the_content(); ?>
    
    <?php if(!$show_ads){ ?>
    <script type="text/javascript"><!--
    google_ad_client = "pub-7346602657553614";
    /* Adamcorley.com Post Block */
    google_ad_slot = "2062016984";
    google_ad_width = 300;
    google_ad_height = 250;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    <?php $show_ads = 1; } ?>
    
        </div>
        </div>
    
    <div class="post-footer-border"></div>
            <div class="post-footer"><span><em><?php wp_link_pages(); ?><?php comments_popup_link(__('Comment'), __('1 Comment'), __('% Comments')); ?></em></span></div>
    
    <br />
    
    <?php comments_template(); // Get wp-comments.php template ?>
      </div>
    
    <?php } ?>
    <?php endwhile; else: ?>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php endif; ?>
    <!-- End .post -->
    
    <?php if ($found == 1) { ?>
    <div style=" margin:.5em 0 1.5em; padding-bottom:1.5em; border-bottom:1px dotted #ccc;"></div>
    <?php $found =0;} ?>
    
     <div class="left"><?php posts_nav_link('','','<< Previous') ?></div>
     <div class="right"><?php posts_nav_link('','Next >>','') ?></div><br /><br />
    
    </div>
    <?php include "leftmenu.php"; ?>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
  4. adamcorley.com
    Member
    Posted 4 years ago #

    Based on that, can you tell me what to arrange?

  5. MichaelH
    Member
    Posted 4 years ago #

    You'll need to provide a link to download the theme you are using and maybe someone can help...

  6. adamcorley.com
    Member
    Posted 4 years ago #

  7. MichaelH
    Member
    Posted 4 years ago #

    I'm guessing you want to look at the leftmenu.php and rearrange that code.

Topic Closed

This topic has been closed to new replies.

About this Topic