PDA

View Full Version : custom item



nathan3
11-04-2015, 04:18 AM
What i would like to do is get code from widget and fill in the items to be sorted dynamically

[likebtn_most_liked title="Most Liked Content" number="5" order="likes" time_range="all" show_likes="1" show_dislikes="0" show_thumbnail="1" thumbnail_size="thumbnail" show_excerpt="0" show_date="0" entity_name="custom_item"]

for instance say I hard code the above shortcode into them and it appears on all pages... I want to make the option .... entity_name="custom_item" | entity_name="post" | entity_name="page" etc...
display posts from certain category and or custom post type but allow the url to tell it which one...

Basically I want on a page it to display pages and on post it needs to display posts and on custom post type " it display the custom post type....

Is there a way to add categories and or dynamically add entity_name="???" based on page...

Also how do i use the custom_item option - what is it?

72

LikeBtn
11-04-2015, 06:16 AM
Hi,

If one inserts Like button into the post using shortcode with Button Name (identifier), votes will be saved in a virtual post type - Custom item.

You can insert [likebtn_most_liked] shortcode into template using https://developer.wordpress.org/reference/functions/do_shortcode/ function.
Use https://codex.wordpress.org/Function_Reference/get_post_type function to determine current post type (post/page/custom post type).

nathan3
11-06-2015, 01:28 AM
Can you explain this for me more clearly..

If one inserts Like button into the post using shortcode with Button Name (identifier), votes will be saved in a virtual post type - Custom item.

LikeBtn
11-06-2015, 05:36 AM
It means that on Statistics page you will see such items in Custom item category and you will not see post title or thumbnail, only identifier.

nathan3
11-07-2015, 12:31 AM
It means that on Statistics page you will see such items in Custom item category and you will not see post title or thumbnail, only identifier.

Do you have an example? I'm a little lost..

LikeBtn
11-07-2015, 05:40 AM
Basically I want on a page it to display pages and on post it needs to display posts and on custom post type " it display the custom post type....
For this task you don't need to use custom items.