Testimonials by WooThemes
How do i query by testimonial Category (2 posts)

  1. jrstaatsiii
    Posted 3 years ago #

    I am trying to filter our testimonials by specific categories. We choose the category from the page editor using Advanced Custom Fields, and I have a variable set up to pass that information to the Testimonial Query. Here is the code I am using:


    However, this does not seem to be working, as all testimonials are still showing up.


  2. DesignerEthan
    Posted 3 years ago #

    I'm not sure why you would use a custom field for a category rather then use the default category.

    You can adjust the query used by filtering the query. Here is a snippet you can expand on to get your desired result.


    Currently that snippet just takes the testimonials and displays them in a random order. You can remove the "'orderby' => 'rand'," piece and edit the "'category' => 0" section to use your category ID. So if you using the default categories with the testimonials and the cat ID is 42 you simply change 'category' => 0 to 'category' => 42.

    Hope that helps / works.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Testimonials by WooThemes
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.