Title: Template functions
Last modified: August 30, 2016

---

# Template functions

 *  Resolved [Loc Pham](https://wordpress.org/support/users/phamdacloc/)
 * (@phamdacloc)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/template-functions/)
 * Is there template functions to retrieve counter information? I’m developing application
   that uses REST to talk to wordpress. My app needs to retrieve information relating
   to ratings for topics and replies.
    I’m interest in the following information:
   1. Get the like/dislike count for a specific topic or reply. 2. Check if the 
   user currently likes/dislikes a specific topic or reply. 3. Get a list of topics
   or posts sorted on like/dislike counts. 4. Setter for likes/dislike for a specific
   post or reply.
 * I’d appreciate any tip on how I can retrieve/set these data.
    Thanks.
 * [https://wordpress.org/plugins/rating-system/](https://wordpress.org/plugins/rating-system/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Alex Alexandru](https://wordpress.org/support/users/vortexthemes/)
 * (@vortexthemes)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/template-functions/#post-6676539)
 * Code tag failed
    Here is the post again
 * 1.
 *     ```
       $post_id = 1;
       get_post_meta($post_id,'vortex_system_likes',true);
       get_post_meta($post_id,'vortex_system_dislikes',true);
       ```
   
 * 2.
 *     ```
       $post_id = 1;
       $user_id = 1;
       $array = get_post_meta($post_id,'vortex_system_user_'.$user_id.'',true);
       if($array != ""){
          if($array['liked'] == "noliked"){
             echo "You like the post with id ".$post_id."";
            }elseif($array['disliked'] == "nodisliked"){
               echo "You dislike the post with id ".$post_id."";
            }
       }
       ```
   
 * 3.Use a custom wordpress query and add those args
 *     ```
       'orderby'	=> 'meta_value_num',
       'meta_key'	=> 'vortex_system_likes',
       ```
   
 * 4. Go to your post(in wp-admin) -> Screen Optios -> Check Custom fields
    You 
   should see vortex_system_likes and dislikes Let me know if is ok
 *  Plugin Author [Alex Alexandru](https://wordpress.org/support/users/vortexthemes/)
 * (@vortexthemes)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/template-functions/#post-6676548)
 * 4.It looks like bbpress doesn’t show custom fields you can modify it manually
   in the database.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Template functions’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/rating-system.svg)
 * [Rating System](https://wordpress.org/plugins/rating-system/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/rating-system/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/rating-system/)
 * [Active Topics](https://wordpress.org/support/plugin/rating-system/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/rating-system/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/rating-system/reviews/)

## Tags

 * [vote](https://wordpress.org/support/topic-tag/vote/)

 * 2 replies
 * 2 participants
 * Last reply from: [Alex Alexandru](https://wordpress.org/support/users/vortexthemes/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/template-functions/#post-6676548)
 * Status: resolved