View Full Version : Small piece of code..is this possible?

05-16-2012, 03:20 PM
I have a piece of code that pulls reviews and allows a business owner to drop the reviews on to their website. I need to limit the number of reviews and ideally I'd like to do that with just the snippet the biz owner drops into their site. Is this possible? Here's a sample of the code:

<div id="repagent_reviews"></div><script type="text/javascript" src="http://awebsite.com/anotherwebsite/wp-admin/admin-ajax.php?action=repagent_reviews_js&id=1182"></script>



05-16-2012, 05:07 PM
Anybody have a thought on this?

Philip M
05-16-2012, 05:27 PM
Please have a look at forum guideline 5. It's ok to occasionally bump a thread, but only when done after an ample amount of time (ie: 2-3 days) have passed without a response, and never more than once. You have bumped after less than 2 hours - we are not standing around here 24/7 to answer your questions.

If you want to limit the number of reviews you will need to use server-side coding.

05-16-2012, 05:36 PM
Apologies for that. I must have missed that when perusing the guidelines.

On your response. Pretend I don't know what that means. Can you elaborate?

Old Pedant
05-16-2012, 09:09 PM
That means that the code on this page:


should do the limiting.

Possibly you could pass another parameter specifying how many reviews you want and then the PHP code can limit them. If the PHP code is pulling the reviews from a database, then the PHP code would simply pass the limit along to the SQL query that gets the data.