Create a author post widget in WordPress


We have learned how to create category post widget, how about a author post widget ? In case you missing previous WordPress posts here is the list

Author posts

We can quickly build author based posts by quarrying posts collections with magic short code , which can be place on content area or sidebar. Here is the short code

Query
display-posts author="bill"
[above query here]

Wanna list by published date ?  use the order and orderby and our display-posts query will look like  

Query
display-posts author="bill" order = "ASC" orderby="date"
[above query here]

Author Post Widget

So we are ready for Author Widget , go head add a sidebar ,Text Widget by using Customize button under Design [Block Editor] or Appearance – Customize [ Classic Editor/WP-Admin panel] and name the Text Widget  (eg: Post by Bill) and the add the display-posts Query to the content area as follow

Query
display-posts author="bill" order = "ASC" orderby="date"
[above query here]

Now you know how to build a Author Post widget without messy code.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.