Viewing 10 replies - 31 through 40 (of 40 total)
  • Where is a page with the modified template that has the sidebar code? And what is the template code – use code buttons when posting code here, please?

    (Also, you do not have a child theme on that site – which is probably moot since this theme is not being updated…)

    Thread Starter rairose

    (@rairose)

    Yes, because it is not being updated, I am not using a child theme.

    The archives page with the side bar has the following code:

    <? get_header(); ?>
    
    	<div id="content">
    		<div id="archive">
    			<div id="posts">
    				<div id="left">
    					<?php if (have_posts()) { ?>
    
    						<?php $post = $posts[0]; ?>
    						<?php /* If this is a category archive */ if (is_category()) { ?>
    							<h2 class="pagetitle">‘<?php single_cat_title(); ?>’ Category Archives</h2>
    						<?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
    							<h2 class="pagetitle">Posts Tagged ‘<?php single_tag_title(); ?>’</h2>
    						<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
    							<h2 class="pagetitle"><?php the_time('F jS, Y'); ?> Archives</h2>
    						<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    							<h2 class="pagetitle"><?php the_time('F, Y'); ?> Archives</h2>
    						<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    							<h2 class="pagetitle"><?php the_time('Y'); ?> Archives</h2>
    						<?php /* If this is an author archive */ } elseif (is_author()) { ?>
    							<h2 class="pagetitle">Author Archive</h2>
    						<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
    							<h2 class="pagetitle">Blog Archives</h2>
    						<?php } ?>
    
    						<div class="navigation">
    							<div class="alignleft"><?php next_posts_link('? Older Entries') ?></div>
    							<div class="alignright"><?php previous_posts_link('Newer Entries ?') ?></div>
    							<div style="clear:both">?</div>
    						</div>
    
    						<?php while (have_posts()) {
    							the_post();
    						?>
    
    							<div class="post main">
    								<div class="date-small">
    									<div class="background">
    										<span class="day"><?php the_time('j') ?></span><br />
    										<span class="month"><?php the_time('M') ?></span>
    									</div>
    								</div>
    								<div class="detail-small">
    									<h1 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
    
    									<h4 class="subtitle">by <?php the_author() ?> in <?php the_category(', ') ?></h4>
    
    									<div class="comments">
    										<?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?> <img src="<?php bloginfo('template_url'); ?>/images/comment.png" alt="Comments" />
    									</div>
    
    									<div class="article">
    										<?php echo the_content('Read the rest of this entry ?'); ?>
    									</div>
    								</div>
    								<div style="clear:both"></div>
    							</div>
    						<? } ?>
    					<?php } else { ?>
    
    						<h2 class="center">Not Found</h2>
    						<p class="center">Sorry, but you are looking for something that isn't here.</p>
    						<?php get_search_form(); ?>
    
    					<?php } ?>
    
    				</div>
    				<div id="right">
    					<?php get_sidebar(); ?>
    				</div>
    			</div>
    		</div>
    
    <? get_footer(); ?>

    Can you repeat @krishna’s original directions:

    Add:

    <div id="right">
    <?php get_sidebar(); ?>
    </div>

    to your page.php just above the line get_footer and see if it works.

    Post back here when that’s done and we’ll be able to try and figure out the best way to change the widths of the containers.

    Thread Starter rairose

    (@rairose)

    Ok, I’ve added that code and now this is the code on page.php:

    <? get_header(); ?>
    
    	<div id="content">
    		<div id="single">
    
    			<?php
    			if (have_posts()) {
    
    				while (have_posts()) {
    				 the_post();
    			?>
    
    				<div id="post">
    					<h2 class="title"><?php the_title(); ?></h2>
    
    					<div id="user-bar">
    						<div id="user">Posted on <?php the_time('l, F jS, Y') ?> by <?php the_author() ?></div>
    						<?php if ('open' == $post->comment_status) { ?><a href="<?php comments_link(); ?>"><span id="comment-no"><?php comments_number('No Comments', '1 Comment', '% Comments'); ?> <img src="<?php bloginfo('template_url'); ?>/images/comment.png" alt="Comments" /></span></a><? } ?>
    					</div>
    
    					<div class="article">
    						<?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>'); ?>
    					</div>
    
    					<div class="pagination">
    						<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    					</div>
    				</div>
    
    			<?
    				}
    			}
    			?>
    <div id="right">
    <?php get_sidebar(); ?>
    </div>
    		</div>
    
    	</div>
    
    <? get_footer(); ?>

    The footer is now appearing at the very bottom of the page.

    Ok, now you should change the names of a couple of the ID values that appear in the divs. Change “single” to “posts,” and then “post” to “left.”

    So you should be left with:

    <? get_header(); ?>
    
    	<div id="content">
    		<div id="posts">
    
    			<?php
    			if (have_posts()) {
    
    				while (have_posts()) {
    				 the_post();
    			?>
    
    				<div id="left">
    					<h2 class="title"><?php the_title(); ?></h2>
    
    					<div id="user-bar">
    						<div id="user">Posted on <?php the_time('l, F jS, Y') ?> by <?php the_author() ?></div>
    						<?php if ('open' == $post->comment_status) { ?><a href="<?php comments_link(); ?>"><span id="comment-no"><?php comments_number('No Comments', '1 Comment', '% Comments'); ?> <img src="<?php bloginfo('template_url'); ?>/images/comment.png" alt="Comments" /></span></a><? } ?>
    					</div>
    
    					<div class="article">
    						<?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>'); ?>
    					</div>
    
    					<div class="pagination">
    						<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    					</div>
    				</div>
    
    			<?
    				}
    			}
    			?>
    <div id="right">
    <?php get_sidebar(); ?>
    </div>
    		</div>
    
    	</div>
    
    <? get_footer(); ?>
    Thread Starter rairose

    (@rairose)

    Ah wonderful!!! Now just one more thing: The article headers are now the same as the general text. For example, “Welcome!” should be a header here: https://www.rairosewriting.com/

    In your style.css file, find the following snippet:

    #archive h2.pagetitle {
    	font-size:2.0em;
    	font-weight:bold;
    	margin:10px 0 20px 0;
    }

    Add #left .title to the selectors so that you are left with:

    #left .title, #archive h2.pagetitle {
    	font-size: 2.0em;
    	font-weight:bold;
    	margin:10px 0 20px 0;
    }

    This should change the “Welcome” heading so that it’s the same style as the heading on the archive page.

    To change the rest of the text so that it is has the same font-size and line-height as the archive page’s text, find the following snippet in style.css:

    #posts #left .post .detail-small .article {
    clear: both;
    font-size: 14px;
    position: relative;
    top: 10px;
    line-height: 22px;
    }

    Change the selector to .article p – your new snippet should read:

    .article p {
    clear: both;
    font-size: 14px;
    position: relative;
    top: 10px;
    line-height: 22px;
    }

    Let me know how you get on with this. Hope it works for you!

    Thread Starter rairose

    (@rairose)

    Thank you SO much, everyone! I really appreciate it ??

    You’re welcome. Glad to help. ??

    I tried the

    <div id=”right”><?php get_sidebar(); ?></div>

    But it did not work. My widgets are still at the bottom of the page (in the footer).

Viewing 10 replies - 31 through 40 (of 40 total)
  • The topic ‘How can I add a right sidebar to this theme?’ is closed to new replies.