• Hi

    I’m trying to display the post author on the single post page, I can get it to display on the archive page but am struggling on the single post page, below is the code I’m using, I presumed it would be the same as the archive page code?

    [ Moderator note: please wrap code in backticks or use the code button. ]

    <em><div class="post-meta">
                    <?php responsive_post_meta_data(); ?><?php the_author() ?>
    
    				    <?php if ( comments_open() ) : ?>
                            <span class="comments-link">
                            <span class="mdash">—</span>
    
                        <?php comments_popup_link(__('', 'responsive'), __('1 Comment ↓', 'responsive'), __('% Comments ↓', 'responsive')); ?>
                            </span>
                        <?php endif; ?> </em>

    Cheers

    Lee

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi there,
    1. What theme are you using?
    2. For your single post page, could you paste the whole page’s code into Pastebin, send the pastebin link here?
    Thanks,
    Paul

    Thread Starter lee demain

    (@lee-demain)

    Paul

    I’m using the responsive theme.

    Pastebin link.

    https://pastebin.com/e4RGziGi

    Cheers

    Lee

    Hey Lee,
    It looks like you have the code inside a conditional statement that will only show stuff if comments are open for the post.

    <?php if ( comments_open() ) : ?>
      <?php
      // ==================================
      // == NOTE: Nothing in here will happen if comments are not open for the single post
      ?>
      <?php get_the_author_meta( $field, $userID ); ?>
      <span class="comments-link">
      <span class="mdash">&mdash;</span>
      <?php comments_popup_link(__('', 'responsive'), __('1 Comment &darr;', 'responsive'), __('% Comments &darr;', 'responsive')); ?>
      <?php $author = get_the_author(); ?>
      </span>
    <?php endif; ?>

    See if that is your problem.
    Paul

    Thread Starter lee demain

    (@lee-demain)

    Hi Paul

    That still doesn’t work, any other ideas?

    Lee

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Display post author on single post page’ is closed to new replies.