WordPress scoring plug-in call.

Source: Internet
Author: User
I installed WordPress and added my own HTML static pages. Now I want to call the scoring plug-in WordPress, how can I make my own pages, disguised as a new WordPress article? The page I wrote also has a scoring function. Now we know that we have installed WordPress using..., and added HTML static pages written by ourselves,

Now I want to call the scoring plug-in WordPress. How can I disguise my own pages as a new WordPress article?
The page I wrote also has a scoring function.

Now we know that you can use the [rate] To Call The scoring plug-in, but advanced customization is not very good ..

The instructions are as follows:

= How do I manually get the most rated posts using PHP? =

$posts = PostRatings()->getTopRated($arguments);

Possible arguments, and their defaults:

'post_type`    => 'post','number'       => 10,                   // max. number of posts to retrieve'offset'       => 0,                    // offset from where to start'sortby'       => 'bayesian_rating',    // bayesian_rating, rating or votes'order'        => 'DESC',               // ASC or DESC'date_limit'   => 0,                    // date limit in days

Return value is an array of post objects ining the usual post properties + 3 extra properties:

$post->votes                            // number of votes$post->rating                           // average rating$post->bayesian_rating                  // weighted rating

Example usage:

global $post;$results = PostRatings()->getTopRated();foreach($results as $post){  setup_postdata($post); ?>  // here is the usual loop  
   - 
  votes), $post->votes); ?>  
  

Reply content:

WordPress is installed, and an HTML static page is added,

Now I want to call the scoring plug-in WordPress. How can I disguise my own pages as a new WordPress article?
The page I wrote also has a scoring function.

Now we know that you can use the [rate] To Call The scoring plug-in, but advanced customization is not very good ..

The instructions are as follows:

= How do I manually get the most rated posts using PHP? =

$posts = PostRatings()->getTopRated($arguments);

Possible arguments, and their defaults:

'post_type`    => 'post','number'       => 10,                   // max. number of posts to retrieve'offset'       => 0,                    // offset from where to start'sortby'       => 'bayesian_rating',    // bayesian_rating, rating or votes'order'        => 'DESC',               // ASC or DESC'date_limit'   => 0,                    // date limit in days

Return value is an array of post objects ining the usual post properties + 3 extra properties:

$post->votes                            // number of votes$post->rating                           // average rating$post->bayesian_rating                  // weighted rating

Example usage:

global $post;$results = PostRatings()->getTopRated();foreach($results as $post){  setup_postdata($post); ?>  // here is the usual loop  
    - 
   votes), $post->votes); ?>  
   

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.