WordPress.org

Ready to get started?Download WordPress

Forums

Two Q: 1: Next/prev post not working. 2: Title and date prob (7 posts)

  1. jorgent
    Member
    Posted 6 years ago #

    Hi.

    I've finally got rid of one problem, but now I have two more :/ I've probably messed up some of the theme files after a lot of copy and paste and undoing with code.

    Problem 1:
    I will have 1 post only on front page. It's not possible anymore to click on Previous/Next Post with Opera. It's ok with Internet Explorer and FF.

    Problem 2:
    How can I have the post title and date on the same line the best way? I actually do have it like that now, but it looks too big in IE.

    Here's my blog:
    http://www.jorgent.com

    I hope someone can help me, cause all the code is really confusing me.

    Cheers!

  2. jorgent
    Member
    Posted 6 years ago #

    Hmm, maybe this is useful to be able to help me. It's the single.php.

    <?php get_header(); ?>
    
    	<div id="content" class="widecolumn">
    
    	<?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 class="post" id="post-<?php the_ID(); ?>">
    			<h2><a href="<?php echo get_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    
    			<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')); ?>
    
    				<p class="postmetadata alt">
    					<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/archives/2004/08/17/time-since-plugin/ */
    							/* $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 comments_rss_link('RSS 2.0'); ?> feed.
    
    						<?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
    							// Both Comments and Pings are open ?>
    							You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(true); ?>" rel="trackback">trackback</a> from your own site.
    
    						<?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
    							// Only Pings are Open ?>
    							Responses are currently closed, but you can <a href="<?php trackback_url(true); ?> " rel="trackback">trackback</a> from your own site.
    
    						<?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
    							// Comments are open, Pings are not ?>
    							You can skip to the end and leave a response. Pinging is currently not allowed.
    
    						<?php } elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
    							// 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(); ?>
  3. jorgent
    Member
    Posted 6 years ago #

    Sorry, wrong code.. It was too late to edit the last post.

    It's the index.php you need I guess.

    <?php get_header(); ?>
    
    	<div id="content" class="narrowcolumn">
    
    	<?php if (have_posts()) : ?>
    
    		<?php while (have_posts()) : the_post(); ?>
    
    			<div class="post" id="post-<?php the_ID(); ?>">
    				<h4><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a> <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></h4></small>
    
    				<div class="entry">
    
    					<?php the_content('Read the rest of this entry &raquo;'); ?>
    
    				</div>
    
    				<p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
    			</div>
    
    <?php $withcomments = true; comments_template();?>
    
    		<?php endwhile; ?>
    
    <div class="navigation">
    			<div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div>
    			<div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></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 include (TEMPLATEPATH . "/searchform.php"); ?>
    
    	<?php endif; ?>
    
    	</div>
    
    <?php get_footer(); ?>
  4. jorgent
    Member
    Posted 6 years ago #

    I'm only bumbing this because I'm going away for a couple of days later this afternoon and I'm hoping to get some helpful tips before that :)

    Cheers and a good weekend to all!

  5. jorgent
    Member
    Posted 6 years ago #

    Bumparoo!

    Maybe I can ask about the most important thing first, and that's the previous/next post problem. Anyone know how to fix it so that it's possible to click on the links in opera?

  6. Chris_K
    Member
    Posted 6 years ago #

    An oldie, but a goodie that a search here turned up: http://wordpress.org/support/topic/85934?replies=7

  7. jorgent
    Member
    Posted 6 years ago #

    Great, thanks! I should have searched better.. Problem 1 solved!

    I don't know which words to use to search for my other problem. I've tried different words but no luck.

    My other problem is that I want the post title and date on the same line. This is the code I use now:

    <div class="post" id="post-<?php the_ID(); ?>">
    				<h4><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h4><small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>

    When I use this code the date is beneath the title. If I put the </h4> after <?php the_time('F jS, Y') ?> then I get it on the same line but then I can't have one size on the title and another on the date. What to do?

    Cheers!

Topic Closed

This topic has been closed to new replies.

About this Topic