I will answer my own question here.
The reason the user information didn’t display is because the php tags need the author ID when used outside the loop.
For instance the following tag:
<?php the_author(); ?>
Should be like this:
<?php the_author_meta('display_name', 1); ?>
This is explain quite well here.
Now the code works just fine.
Related Posts:
- Include WP_Query in my own PHP file?
- Include a external PHP file into a WordPress Custom Template
- Include files in functions.php
- load/require specific php files for specific pages/templates/post types
- the_author_posts_link css class
- How do I get the author’s page url from their ID?
- Current post’s author name in the author meta tag
- ob_get_clean returns empty string, ob_get_flush outputs string
- Allow authors to post only in categories they create in WordPress
- where to include a php file
- Missing Author Information
- Include Class File in WordPress
- nowplaying.include.php Will Not Display Results
- integrating external php library into wordpress- the right way
- Change title and meta description in included page (not template)
- Can I change a variable in a content part while calling it?
- Get_the_author doesn’t return author name
- How do I use the Simple HTML DOM Parser in plugin when other plugin already uses it?
- When using the_author hook, how can I determine the PHP file that generates each call to `the_author()`?
- Put CSS inside a PHP file and include it the right way
- How Can I Call Up The Author’s Name on a Post
- Get Current User Id Inside a Loop Returns 0 For a Shortcode
- Retrieving Author ID in wp-admin area
- functions.php is being included twice, creating PHP fatal errors
- Custom theme: Alternatives to long list of ‘include’ in functions.php
- Storing Array from returned database query and using the array in a new query
- PHP help get_template_directory + PHP include
- Getting the author name on author archive page
- code is skipping a div
- edit_comment_link is not showing for comment author
- Why does abstracting html from plugin code result in loss of access to wordpress functions?
- Remove author link wherever author’s name is display
- PHP include is only working in certain places in my custom WP theme
- Correct and safe way to include php content in my page
- What is the proper way to include a PHP framework into my theme?
- php include not working in custom page
- Post’s ID pattern?
- Using WP functions such as the_title() in an included php file
- What’s the best way to include PHP code in pages?
- Noindex Posts From Certain Authors In WordPress
- How to include custom PHP file both in header and footer files
- Noindex subscriber author page
- How to hide the author box of a specific user?
- Include a file that has a function in it
- Comment_author_url doing nothing
- How do I call an external php non WordPress class into functions.php?
- Create condition for Author bio Social Links
- How to change the author box selection on a post to a custom taxonomy
- Remove Author Links
- WordPress redirect to a subpage – how to create a template for subpage?
- Show all people who commented on all posts by an author
- require get_template_directory() . ‘path/to-my/file.php’ BREAKS customize > themes functionality
- Show sidebar only to author of post
- Posts missing on author page
- Before & After Content – After Content directly below Before Content when using require_once
- Return author name as a tag using get_author
- Send Notification to all users that followed some author
- Following/Followers Users list Using Ajax Pagination inside Author Profile
- Send email to users when they get new followers
- loading a php file to a specific page id
- How do I fetch a data from an external database into my wordpress homepage
- How do I fetch a data from an external database into my wordpress homepage
- How to make a parent page for author.php?
- PHP get_category() function redeclared
- Changing WordPress author name in database
- Showing the authors username and bio on custom author.php
- How can I output the slug of a comment author?
- How to have Function of a plugin using global vars into a shortcode?
- How do I / Is it possible to execute an external PHP file / function inside WordPress?
- Include a php file that is above WP installation hierarchically?
- How can I include a file related to blog URL? Nothing seems to work
- WordPress blog set up
- When I use rewind_post() it shows menu items in my loop
- Shortcode not passing variable to included file
- php “use” not working in template [closed]
- How to include a php file in every post and page [duplicate]
- Shortcode to include PHP file, pass various parameters to include?
- wordpress.org disallowing my plugin becuase of loading core files in cron cpanel file
- Assign new post author IF another user in custom field on post transition
- Create guest author page via php
- Should I use include(_once) or require(_once) for loading php-file with customizer settings?
- How to Dynamically Change the author_base URL Slug by Language in WordPress?
- Running rmdir function on post save
- Logic on a Gravity Forms redirect [closed]
- How to add div blocks after certain set of post
- How to pass a PHP $_GET variable and fetch/output it?
- how to disabled a button when press three times
- Get html data with javascript to php array and store to wordpress database
- Echo a shortcode div after every 3 posts
- Preg_Match(): compilation failed unknown property name
- Post images are not displayed on the front page
- do_action(), iFrame Gets Displayed Despite Password Protection [closed]
- $wpdb returns duplicate posts
- How to avoid duplicates when creating recent network posts
- esc_url( ) won’t use https
- Get all categories post is not in
- zip unzip attachments in wordpress
- php if username is role
- Function returns post URLs rather than retrieving Facebook Graph API data
- Ajax button not working