• Hi there,

    Could somebody tell me how to display the “posted on” date underneath the latest news and latest blog posts on this static page (www.rjt-online.com/wp)?

    I am displaying the Latest News posts using this code:

    <div id="container">
    <span id="archives">
    <h3 class="widget-title-left">LATEST NEWS //</h3>
    			</span>
    			<div id="content" role="main">
    
    <?php 
    
    query_posts('posts_per_page=3&cat=23');
    if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
    
    				<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    					<?php if ( is_front_page() ) { ?>
    						<h2 class="entry-title"><?php the_title(); ?></h2>
    					<?php } else { ?>
    						<h1 class="entry-title"><?php the_title(); ?></h1>
    					<?php } ?>				
    
    					<div class="entry-content">
    						<?php the_content(); ?>
    						<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
    						<?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>
    					</div><!-- .entry-content -->
    				</div><!-- #post-## -->
    
    				<?php comments_template( '', true ); ?>
    
    <?php endwhile; ?>
    
    <span id="archives">
    <a href="https://www.rjt-online.com/wp/home/news-archive/" class="instructiontext">More News Articles →</a>
    			</span>
    
    			</div><!-- #content -->
    </div>
Viewing 8 replies - 1 through 8 (of 8 total)
  • <?php the_time('j F Y') ?>
    But you don’t have other ‘metadata’ either.

    Thread Starter chrischickenwire

    (@chrischickenwire)

    Thanks for the reply ??

    What do you mean by that?

    Where should I be posting that code?

    Sorry, I thought you wrote that script above yourself. In that case I’m probably as little a coder as you.
    This comes from my theme:
    <div class="postmetadata"><?php the_time('j F Y') ?> <!-- <?php _e('by') ?> <?php the_author() ?> --></div>
    which is a complete line of code that you should be able to use (in may layman view), when you paste it, say, above the comments_template line.

    Give it a try. If that doesn’t work or breaks your theme (white screen on the website), remove it, and wait for a real coder ??

    Thread Starter chrischickenwire

    (@chrischickenwire)

    No that’s great thanks Roy!

    Thread Starter chrischickenwire

    (@chrischickenwire)

    One more thing if you’ve got a moment Roy. I’m trying to change the date format in the main index.php file too so that it displays that way across my main blog page, but that file doesn’t seem to reference a date format.

    Any idea how I could change it?

    The code for that page is:

    <?php include ('blogheader.php'); ?>
    
    		<div id="container">
    <span id="archives">
    <h3 class="widget-title-left">LATEST BLOG //</h3>
    			</span>
    			<div id="content" role="main">
    
    			<?php
    			/* Run the loop to output the posts.
    			 * If you want to overload this in a child theme then include a file
    			 * called loop-index.php and that will be used instead.
    			 */
    
    //The Query
    
                               query_posts('posts_per_page=5&cat=22');                         
    
    			 get_template_part( 'loop', 'index' );
    			?>
    			</div><!-- #content -->
    		</div><!-- #container -->
    
    <?php include ('sidebar_blog.php'); ?>
    <?php include ('blogfooter.php'); ?>

    First try to see if it helps to change the setting in the WP dashboard (settings->general)

    Thread Starter chrischickenwire

    (@chrischickenwire)

    That’s not strictly what I mean Roy. What I want to display is exactly what I have displayed on the home page posts (https://www.rjt-online.com/wp -“Posted on date, time”). I want to display it exactly the same on the blog posts in index.php, but there is no reference in that file so I believe I have to alter the functions file somehow.

    I guess the same code that I gave you and then probably between #content and #container, but I’m not 100% sure.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Any idea why the date isn't displaying here…’ is closed to new replies.