skip to Main Content

Testimonials Add on WordPress Plugin

We were looking at placing “Reviews” or “Testimonials” on our site.  But didn’t want to use anyone of those great WordPress plugins out there simply because the “Total Theme” by comes with it’s own “Testimonials” custom post type.testimonials

So with this we had to do the following:

  1. Create a metabox for the Testimonials Custom post type. That, together with the testimonial page form, accept the following inputs: a) Company Name, b) Position and c) Company Website URL.
  2. Create or adapt a rotating testimonial script to display Testimonials on the front end through a widget.

So we set out working on the plugin. I will not go into any intricate details just what we basically did to make the plugin work for us.

  1. We created the basic index of the plugin
  2. Included the files
    • etn_init_testiomonial_fields.php – Where we initialized and created the metabox
    • etn_testimonial_widget.php – Where we created the widget to display testimonials on the front-end. We searched for jquery scripts, css scripts anything that we could get our hands on but this was the only one we could get to work, this script from cssglobe.com (thanks!)
  3. The tricky part: we only wanted to show testimonials on the “Services” archive and “Services” pages so we had do a conditional within the index of the plugin.  We had to do this because we used the  Widget Logic plugin to specificy which pages to show the widget. The thing is, the enqueued or defined javascripts were initializing even on pages where the widget was not showing thereby crashing the browser. So, in conjuction with we included the following piece of coding to dequeue said javascripts.reviews

if((!in_category('services'))){
wp_dequeue_script('jqueryx'); # Restrict scripts.
wp_dequeue_style('my_stylesheet'); # Restrict css.
}
}

Source: http://orbitingweb.com/blog/preventing-plugins-from-loading-js-css-on-all-pages/

Our code, is admittedly some shitty (pardon the german) piece of work..  But it works. I know, there are a lot of other testimonial plugins out there, well this one works for us exactly how we want it.. For those wanting to use the plugin, shoot me an email at alphonse[dot]tan[at]etnmultimedia.com.  For those who have used this and liked it enough to send me a cup of Coffee. please do.

Testimonials Add on WordPress Plugin Gallery

  • test-page

Alphonse

Editorial Staff at ETN Multimedia is led by Alphonse Tan. Page maintained by Alphonse Tan

Back To Top