To display the author’s avatar within The Loop use get_avatar()
like that:
<?php print get_avatar(get_the_author_meta('ID'), '30', '', '', ['class' => 'foo-bar']); ?>
To display the author’s display name within The Loop use the_author()
:
<?php the_author(); ?>
So put everything inside The Loop and then:
<?php
while (have_posts()) : the_post();
?>
<div class="row">
<div>
<h1 class="primary-color">
<?php the_title(); ?>
</h1>
<span class="avatar">
<?php print get_avatar(get_the_author_meta('ID'), '30', '', '', ['class' => 'foo-bar']); ?>
</span>
by <span class="primary-color"><?php the_author(); ?></span>
<span class="pipe">|</span>
<span class="date"><?php echo get_the_date(); ?></span>
</div>
</div>
<div class="row">
<?php the_content(); ?>
</div>
<?php endwhile; ?>
Related Posts:
- 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
- Allow authors to post only in categories they create in WordPress
- Get_the_author doesn’t return author name
- the_author() not working outside the loop
- When using the_author hook, how can I determine the PHP file that generates each call to `the_author()`?
- 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
- Storing Array from returned database query and using the array in a new query
- Getting the author name on author archive page
- edit_comment_link is not showing for comment author
- Remove author link wherever author’s name is display
- Noindex Posts From Certain Authors In WordPress
- Noindex subscriber author page
- How to hide the author box of a specific user?
- Comment_author_url doing nothing
- 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
- Show sidebar only to author of post
- Posts missing on author page
- 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
- How to make a parent page for author.php?
- 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?
- When I use rewind_post() it shows menu items in my loop
- Assign new post author IF another user in custom field on post transition
- Create guest author page via php
- Get only enqueued styles and scripts of the current theme
- WordPress “phpmailer_init” not working for me
- How do I hook into WordPress to save an uploaded photo as an alternate size to an existing photo?
- How to output a permanently delete comment link?
- get image url inside the content in wordpress?
- Rectangle avatars
- delete an array element when its date expires
- Is it possible to use the featured image of a page as a css background without inlining?
- PHP syntax error when using wpdb update?
- Select dropdown not showing selected value php
- Warning: array_pop() expects parameter 1 to be array, boolean given
- How to migrate the posts from an old custom legacy blog to a new WordPress website?
- items_wrap not working
- Using shipped version of jquery
- Can’t search posts using WP_QUERY inside AJAX Function
- How do I Add HTML to the_excerpt() & the_content() Output?
- Display fields as values in array from external SQL DB
- User’s total comment count excluding comments on their own posts
- Populate dropdown with Child Pages based on Parent Page chosen
- How can I remove a function that has been added to wordpress with add_filter?
- do search in two site and show the result in first site
- What’s the uses of wp_cache_set() or wp_cache_add()?
- How to get post’s current parent term ID?
- How would an if statement surrounding a custom field with two variables (holding values) look like?
- get_the_title() gets printed out twice
- What does this mean in wordpress? Easy question
- Add Codepen animation as Preloader to WordPress
- Setting user nickname and displayname to shortened email
- Error Uncaught ArgumentCountError i cant find it
- Use $wpdb or other PHP script method to find/replace in WP database
- Simple WordPress endpoint route doesn’t work
- How do I create a function that modifies a message in the wp-login.php file?
- Why when I create a new post I found 2 record related to this post into the posts database table?
- Trying to display terms from custom taxonomy within function
- WP_Query for woocommerce products with a pattern as a post_title
- What’s wrong in my PHP code? I’m using WordPress Astra Theme and I can’t insert data into my SQL
- Displaying a List of Changes / Updates on the Website Publicly
- 404 on old link after changing post url
- Dropdown category field inside repeatable metabox
- How to add Text before my Custom Term and hide it when empty
- how to fix Warning: A non-numeric value encountered in this specefic line of code
- Responsive loop with 3 columns inside row then 2 columns
- How To Get HTML Eelement From Another Page
- Cron job -many duplicate posts
- Annoying/confusing WordPress memory limit exhausted
- Unexpected behavior when trying to manually install WordPress on macOS Sierra
- how to call other plugins once custom post has been inserted
- Force ‘permanent’ post cache of shortcode results
- How to fix UpdraftPlus’s memory issue?
- Are WordPress widgets cached?
- Are widget arguments always set inside My_Widget::widget()?
- How to fix blank pagination links?
- Fatal error: Call to a member function get_results() on a non-object in on line 26
- Different image and background color depending on page type
- Inserting A Feed and Sidebar into an HTML Page
- How To: Simple domPDF Example
- SVN precommit and nullable return types [closed]
- Encode code snippet in AJAX endpoint
- How Can I Edit a WordPress Site’s PHP Files Without Breaking the WP Install?
- How to edit the default database of WordPress [closed]
- how to use header function in wp-load.php file [closed]
- 404 page is not the same when using PHP code in functions
- Add text below WooCommerce short description if metabox value is true