Support » Fixing WordPress » the_author() not working

  • pauarge

    (@pauarge)



    Hi!

    I have a very strange issue in my blog: when I use the function the_author() in the file single.php (in my own template), it doesn’t show the author’s name.

    If I use other metadata like the_tags(), it works. Also, if I use the function in other file (like post-single.php) works.

Viewing 3 replies - 1 through 3 (of 3 total)
  • WPProHelp

    (@wpprohelp)

    Can you post the code you are trying to use?

    pauarge

    (@pauarge)

    This is my single.php file:

    <?php global $theme; get_header(); ?>
        <div id="main">
            <?php $theme->hook('main_before'); ?>
            <div id="post-header">
            	<div id="post-header-top">
                	<div id="post-title"><?php the_title(); ?></div>
                </div>
                <div id="post-header-bottom">
                	<div id="post-meta">
                    	<p>Per <strong><?php the_author(); ?></strong> <span class="data-entrada">el dia <?php echo get_the_date(); ?></span></p>
                    </div>
                    <div id="post-class">
                    	<?php the_tags('<ul class="post-tags"><li>','</li><li>','</li></ul>'); the_category(); ?>
                    </div>
                </div>
            </div>
            <div id="content">
                <?php $theme->hook('content_before');
                    if (have_posts()) : while (have_posts()) : the_post();
                        /**
                         * Find the post formatting for the single post (full post view) in the post-single.php file
                         */
                        get_template_part('post', 'single');
                    endwhile;
    
                    else :
                        get_template_part('post', 'noresults');
                    endif;
                $theme->hook('content_after'); ?>
            </div>
            <?php get_sidebars();
            $theme->hook('main_after'); ?>
        </div>
    <?php get_footer(); ?>
    Michael

    (@alchymyth)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘the_author() not working’ is closed to new replies.