Posts by User

This shortcode will display the recent posts made by user in a nice grid or compact layout.

How to Embed This Shortcode in Editor

[userpro template=postsbyuser]

How to Embed This Shortcode with PHP

<?php echo do_shortcode('[userpro template=postsbyuser]'); ?>

Shortcode Options

Example

Options are used to customize the shortcode and can be assigned as a pair option=value in your shortcode like this.

[userpro template=postsbyuser option=value]

  • postsbyuser_num – How many recent posts to display from this user. Default: 12
  • postsbyuser_types – Allowed post types to include in the grid of posts. By default: post (Show posts only). You can allow one or multiple post types, or ALL post types. To show multiple post types use: “product,custom_post_type” (comma seperated list of allowed post types, or one post type) To enable ALL post types use: “any”
  • postsbyuser_mode – Control the display of posts, this value can be “grid” or “compact”. Default value: grid
  • postsbyuser_thumb – For use in compact mode only. Defines the size of post thumbnail that appears in list. Default: 50
  • postsbyuser_showthumb – For use in compact mode only. Show/hide the thumbnail of post. Default: 1 (to show)
  • postsbyuser_taxonomy – This takes effect If you use postsbyuser_category option to show posts from specific categories. This value should be a valid taxonomy slug. Default: category
  • postsbyuser_category – To show posts from specific category (or categories) enter the IDs as value, comma-seperated. To show posts from category 1, 4, and 6 (using IDs) use postsbyuser_category=1,4,6 or use a single category ID for one category. Default: none to display posts from any category (Have no effect if empty!)
  • user – To show posts by user for author, use user=author (e.g. in Author posts), or user=CUSTOM_USER to show posts of specific user. If this option is not used, the user will be defined automatically based on user profile being viewed.
  • post_paginate – Enable/disable pagination with post_paginate, Default : 1 (Pagination is On by default); and specify number of posts on a single page with postsbyuser_num.
  • usercanedit – Enable/disable edit and delete the post from frontend by user , Default : 1

Was this article helpful?

Related Articles

Leave A Comment?