Solved

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

Posted on 2012-04-10
5
413 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Phone Dialer 5 38
PHP string issue 5 18
Apostophes in PHP generated form 6 20
Create html table using xsl 8 12
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now