Skip to content

Getting Started with WP ULike Shortcodes

WP ULike Shortcode

Every WordPress developer and site admin knows the value of a shortcode. Many plugins and themes use them to add specific functions and dynamics to web pages. We had some shortcodes in our free version, but with spreading the functionality of WP ULike Pro Plugin, we designed much more useful shortcodes for our paid version. in this article, we will discuss what are these shortcodes and teach you how to use them properly.

What are shortcodes?

Shortcodes in WordPress are little bits of code that allow you to do various things with little effort. They were introduced in WordPress 2.5, and the reason to introduce them was to allow people to execute code inside WordPress posts, pages, and widgets without writing any code directly. This allows you to embed files or create objects that would normally require a lot of code in just one single line. For example, a shortcode for embedding a video might look like this:

[video]

They can also come with attributes. For example, the built-in WordPress video shortcode can take an src attribute:

[video src="video-source.mp4"]

WordPress comes with several that are built-in. These include an audio, caption, embed, gallery, and video. Others can be added by plugins using the Shortcode API.

how to insert shortcodes in WordPress plugin such as wp ulike?

Actually, this is the easiest part. just copy the shortcode from the source and paste it in your WordPress page editor, that’s it. but before that, you should know what that mini code does and how it affects your page. Many of them are self-explanatory, but they usually come with a GitHub page to guide you throw the code and its functions.

How to edit shortcode in wp ulike?

There is only 1 shortcode available for our free users, meanwhile, we added a WP ULike ShortCode Generator Pop-up to the paid version.

wp ulike shortcode generator

In order to insert Like button inside a content use the following shortcode:

Display CTA button

[wp_ulike]

Parameters ( attributes ):

  • for (string) – select button type (Available Values: postcommentactivitytopic)
  • id (integer) – select specific item ID. (For manual usage)
  • button_type (string) – Set Button Type (Available Values: imagetext)
  • style (string) – Choose the default template from the available list.
  • wrapper_class (string) – Extra Wrapper class

See? that was easy. This shortcode is available in our free users. but let’s talk like a pro.

WP ULike Pro Shortcode guide

We added a unique WP ULike Shortcode Button to WordPress Editor page which makes things very easy. you just click on attributes you want in the pop-up window and it generates the shortcode. This shortcode generator is only available in the paid version of the plugin.

User info display

[wp_ulike_pro_user_info type="data_counter"]

it’s the default code, which can show any user’s activity in Post, comments, activity, and topic such as like, dislike, unlike, and undislike.

the other types are Last Activity and Last Status, which shows what their name suggests respectively. in every 3 types of using this ShortCode,  you can add before and after the text to these outputs in the respective fields and also a specific message if the requested value is empty. so the attributes of this code are:

  • ID(int): this attribute choose which user data to show
  • type(string): this one determines which type of data from the user will be shown.
  • table(string): and this one specifies the source table such as Post, comments, activity, and topic.
  • status(string): and this last one distinguishes which data to be shown in the results (Available Values: like, dislike, unlike, and undislike)

Get Items List

If you need to extract a specific value from the logs database, you can use this shortcode. this SC can show status and a preview of types in the results.

[wp_ulike_pro_items type="post" rel_type="post" status="like"]

for example, this code will return the post on your website which anyone liked. the shortcode attributes are:

  • type(string): this one determines which type of data from the user will be shown.
  • rel_type(string): if “type = post”, you can choose the desired table from these values (Post, comments, activity, and topic)
  • status(string): and this last one distinguishes which data to be shown in the results (Available Values: like, dislike, unlike, and undislike)

User Profile

If you need to show a User Profile on a page, this code will do it by calling the user ID and returns the user profile as a result.

[wp_ulike_pro_completeness_profile user_id="56"]

the only attribute to this code is:

  • user_id(int) it determines which user info to show in the result.

How to edit WP ULike shortcode in Elementor?

There is an Elementor Widget named Shortcode, you can easily copy and paste your shortcode in this widget and use them on any page you want or need.

was this article helpful?
5
0
Share on facebook
Share on linkedin
Share on twitter
Share on telegram
Related Posts
Comments

No comment yet, add your voice below!


Add a Comment

Your email address will not be published. Required fields are marked *

Boost Your SEO by Using Rich Snippets Generator...