[Plugin: Quotes Collection] HOW TO: Show Quote by ID
-
Feature Addition:
I created a portfolio of projects and had my clients send me testimonials. I then entered the testimonials into the Quotes Collection and wanted to show specific testimonials per client. Here is what i did to solve this (in version 1.5.6 of Quotes Collection), and I hope this can be incorporated into the next version.
– In my WordPress Page which has my Portfolio contents (title, text, images, categories, etc), I added a custom field named “Quote”, with the value of the ID of the relevant quote in the Quotes Collection list
– I updated the quotes-collection.php page in the plugin to accept a new $options_default argument at line 237: ‘id’ => ”,
– Added some SQL into the $condition string and $options array in quotes-collection.php like so, now at line 266 (we want to suppress the random quote function):
if($options[‘id’]) {
$condition .=” AND quote_id = “.$options[‘id’];
$options[‘random’] = 0;
}– Then in my template i used the following to grab the Quote ID (if true) and display the quote for that specific ID (suppressing the show_source and ajax_refresh):
$quoteid = get_post_meta($post->ID, ‘Quote’, true);
quotescollection_quote(‘show_source=1&ajax_refresh=0&id=’.$quoteid);Note: id the $quoteid isn’t present, then it shows a random quote!
- The topic ‘[Plugin: Quotes Collection] HOW TO: Show Quote by ID’ is closed to new replies.