WordPress.org

Ready to get started?Download WordPress

Forums

Adding date and comment data below title (8 posts)

  1. chaseblackwell44
    Member
    Posted 4 years ago #

    I would like to create date and comment data underneath my title border line. No clue how to go about it.

    Here is an example of what I'd like to do:
    http://img708.imageshack.us/img708/3161/headerexample.jpg

    http://www.chaseblackwell.com

  2. MichaelH
    Member
    Posted 4 years ago #

    Look at the WordPress Default theme's wp-content/themes/default/index.php and how it utilizes the template tag, the_time(), and comments_popup_link.

    Related:
    Stepping Into Template Tags
    Stepping Into Templates
    Template Hierarchy

  3. chaseblackwell44
    Member
    Posted 4 years ago #

    Ha, strangely all that is included in the default index.php file on my server is:

    <?php
    /**
     * @package WordPress
     * @subpackage Default_Theme
     */
    
    get_header(); ?>
    
    	<div id="content" class="narrowcolumn" role="main">
    
    	<?php if (have_posts()) : ?>
    
    		<?php while (have_posts()) : the_post(); ?>
    
    			<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    				<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    				<small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>
    
    				<div class="entry">
    					<?php the_content('Read the rest of this entry &raquo;'); ?>
    				</div>
    
    				<p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
    			</div>
    
    		<?php endwhile; ?>
    
    		<div class="navigation">
    			<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
    			<div class="alignright"><?php previous_posts_link('Newer 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 get_search_form(); ?>
    
    	<?php endif; ?>
    
    	</div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    No mention of template tag or date to be found.

    I found the comment tag, however.

    <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>

    How exactly would I know where to place this in my templates index.php file? Guess and check?

  4. MichaelH
    Member
    Posted 4 years ago #

    When you visit Administration > Appearance > Themes, what is the name of the theme you are using? It will also tell you All of this theme’s files are located in /themes/xxxxxxx where xxxxxx is the folder name for that theme.

  5. chaseblackwell44
    Member
    Posted 4 years ago #

    Sure, I know my theme. I mean't more where do I input the code in order to get it to appear where I'd like it to beneath the border of my title?

  6. MichaelH
    Member
    Posted 4 years ago #

    After something like:
    <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>

  7. chaseblackwell44
    Member
    Posted 4 years ago #

    Okay well, I got it up there, but how do I get it aligned correctly? I'm guessing through CSS, but how do I get CSS to distinguish between the comments at the top vs the bottom?

  8. chaseblackwell44
    Member
    Posted 4 years ago #

    Also, I could use some help getting the date up there with the right mm/dd/yyyy format.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.