How to display current user pinned posts?

You can use following code to make a custom shortcode to display current user pinned posts inside your wordpress pages:

Now you can use [user_pinned_posts] shortcode with following attributes:

  • past_days : Display days limit
  • per_page : How many items per page
  • post_type : Specify post type

If you want to use this code inside our profile builder (pro version), you can replace the following variable:

$currentUser = is_user_logged_in() ? get_current_user_id() : wp_ulike_generate_user_id( wp_ulike_get_user_ip() );

With this code:

global $wp_ulike_user_profile_id; $currentUser = $wp_ulike_user_profile_id;

Then you can use this [user_pinned_posts] shortcode inside your profile builder tabs.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us