Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Using WP-PostRatings in "submit your opinion" part of WordPress site

Posted on 2012-04-10
5
427 Views
Last Modified: 2012-04-15
Hi Folks,

Ok...I know I'm not the sharpest tool in the shed--that being said, I'm working on a Wordpress site where I want users to:
*post an opinion/review of a business
*rate the business using a five star rating system.

I've activated WP-Postratings. How do I make it so the rating mechanism is available when a person writes a review? Because each post is different....

Thanks
D
0
Comment
Question by:dlewis61
  • 3
  • 2
5 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 37841048
>> How do I make it so the rating mechanism is available when a person writes a review?

According to that plugin's instructions you can do it one of two ways:

1) Edit your theme's single.php template and add the following code where you want the ratings to show up:

<?php if(function_exists('the_ratings')) { the_ratings(); } ?>

Open in new window


2) In the visual editor, use the shortcode [ratings]
0
 

Author Comment

by:dlewis61
ID: 37841076
Thanks. I'll give this a try, but  I can't conceptualize that each time someone creates a new review, this code would be there. I won't know til I get in there though.
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 350 total points
ID: 37841093
>> I can't conceptualize that each time someone creates a new review, this code would be there

How so?

The way WordPress (and all CMS platforms) works is that there is a single template file that controls the display of data.  It's not like Web 1.0 where you have:

page1.html
page2.html
page3.html
etc.

where each file has the content.  Instead, all of your content is stored in a database and the single display file queries the database with the parameters selected by the user (the item they click on) and returns the relevant content.  This plugin works off the same system.  It stores the ratings and reviews in a database table of its own and uses the same post ID to reference the entries.  When you click on a specific post, the plugin queries its database and returns all of the matching reviews for that post in whatever format it supports.

Does this help or did you mean something else?
0
 

Author Comment

by:dlewis61
ID: 37849215
You rock!! This concept was never explained to me like that. I used the [ratings] in visual editor and it works!! I will close this question but if I have more questions I will just post again.
Thanks so much!
d
0
 

Author Closing Comment

by:dlewis61
ID: 37849217
very informative and gives background explanation to resolution.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses four methods for overlaying images in a container on a web page
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question