• Resolved fragmonger

    (@fragmonger)


    Hi everyone. I’m pretty new to all this. I’m using a theme that, aparently, does not allow me to have a ‘by’ line on my individual posts.

    I’d like to keep the theme, but I need to add a by line. How can I do that?

    My site: https://www.360rantrave.com/

    Thank you.

Viewing 9 replies - 1 through 9 (of 9 total)
  • look at how the default theme adds it…

    In the WordPress Default 1.6 theme, the author of a post is not displayed, but the code is there so use that as an example.

    In wp-content/themes/default/index.php change this code:
    <!-- by <?php the_author() ?> --></small>
    to
    by <?php the_author() ?> </small>

    Essentially you are ‘uncommenting the code’ so that it works.

    Resources:
    template tag
    the_author()
    Editing Files
    Stepping Into Template Tags
    Template Hierarchy

    Thread Starter fragmonger

    (@fragmonger)

    Thanks. I’ll give it a try.

    Thread Starter fragmonger

    (@fragmonger)

    EDIT.

    Read through the code again it’s just as Michael said.

    Thread Starter fragmonger

    (@fragmonger)

    I think I found it & I un-commented the code. Should the ‘by’ line exist now on my exists posts or only on new ones?

    Thanks.

    Thread Starter fragmonger

    (@fragmonger)

    Here is the full text of my index.php file now. The code has been un-commented, but I saw no ‘by’ line on a new post I just made.

    What have I done wrong?

    Thanks.

    <?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(); ?>”>
    <h2>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?></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 »’); ?>
    </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 endwhile; ?>

    <div class=”navigation”>
    <div class=”alignleft”><?php next_posts_link(‘« Previous Entries’) ?></div>
    <div class=”alignright”><?php previous_posts_link(‘Next Entries »’) ?></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_sidebar(); ?>

    <?php get_footer(); ?>

    It’s still commented. Looking at your source code I see this.
    <small>January 15th, 2008 <!-- by Frag Monger --></small>

    Thread Starter fragmonger

    (@fragmonger)

    Got it!

    I’m a moron. I edited the index.php file for a theme I wasn’t using! (D’oh!)

    Thanks to all for the help! ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How can I add a ‘By’ line?’ is closed to new replies.