WordPress.org

Ready to get started?Download WordPress

Forums

Testimonials by Aihrus
[resolved] [Plugin: Testimonials Widget] Sorting (16 posts)

  1. brdecloss
    Member
    Posted 1 year ago #

    What "fields" can you sort on in the Testimonials Widget? I can't seem to sort (i.e. orderby) on Company, URL, or email. I would like to have testimonials by state and have them sorted by city within state. How can I do that? Thanks. /Bob DeCloss

    http://wordpress.org/extend/plugins/testimonials-widget/

  2. Michael Cannon
    Member
    Plugin Author

    Posted 1 year ago #

    I've update release 2.1.2 to support a meta_key option for sorting by testimonial post meta values. See the shortcode options and examples at http://wordpress.org/extend/plugins/testimonials-widget/ for further details.

    In short though, you can try [testimonialswidget_list meta_key=testimonials-widget-company order=asc limit=10].

    However, regarding your city and state information, there's currently no addressing meta data provided. You could probably add that yourself via theme functions though.

  3. brdecloss
    Member
    Posted 1 year ago #

    Would it be possible to "trick" the system into using the url and/or e-mail as a sort field, then? In other words could we store "city" as a url and then use the meta_key for sorting? Thanks for the response. /Bob DeCloss

  4. Michael Cannon
    Member
    Plugin Author

    Posted 1 year ago #

    Bob,

    That sounds reasonable. Your options for the meta_key are testimonials-widget-company, testimonials-widget-email, testimonials-widget-url. Currently, commas aren't allowed in the meta_key, but will be for 2.1.3.

    Next, you might want to set hide_url=true in your shortcode or widget settings so that a city or state isn't tried to be converted to a URL.

    Buona fortuna!

  5. brdecloss
    Member
    Posted 1 year ago #

    That didn't seem to work, at least as I thought. Here is my code:

    [testimonialswidget_list tags=AZ meta_key=testimonials-widget-url order=asc hide_source=true hide_company=true hide_email=true hide_url=true]

    This appeared to only select the AZ tags and list them in descending "ids" order. I wanted to select only those tags that match Arizona, for example, and then sort those by city, which is currently stored in the "url" slot. /Bob DeCloss

  6. Michael Cannon
    Member
    Plugin Author

    Posted 1 year ago #

    Bob, I'm traveling today in rural Italy. I'll try to replicate your scenario when able by Monday afternoon.

  7. brdecloss
    Member
    Posted 1 year ago #

    It seems to be working now. When I looked at the html code there was a ... tag inserted at the beginning and somewhere in the middle of the shortcode. I removed that and it seems to be working. It just shows AZ now in order=asc and when I leave order out, it defaults to desc.

    Here is what I found in the html code:

    [testimonialswidget_list category=AZ meta_key=testimonials-widget-url hide_source=true hide_company=true hide_email=true hide_url=true]

    Not sure how that got there or even what it is. Thanks. /Bob DeCloss

  8. brdecloss
    Member
    Posted 1 year ago #

    That's interesting. When did the post, the ... disappears. It was at the beginning, before the "[" and right after the "AZ", just for your edification. Again, not sure how it got there. At one point I did just copy and paste your shortcode from the above response. I see now that is what happened. At the beginning of your shortcode is and the is at the end. I copied that and did some editing in text mode not html mode and it got fouled up somehow. /Bob DeCloss

  9. Michael Cannon
    Member
    Plugin Author

    Posted 1 year ago #

    Can you please copy and paste the shortcode here?

    Use an extra [ ] around it to see the code correctly.

  10. brdecloss
    Member
    Posted 1 year ago #

    Here it is:

    [<p>[testimonialswidget_list category=AZ meta_key=testimonials-widget-url hide_source=true hide_company=true hide_email=true hide_url=true]</p>]

    Like I say, it is working now that I removed the "code" tags. /Bob DeCloss

  11. brdecloss
    Member
    Posted 1 year ago #

    Sorry, the "code" tags still don't show, even with the [] on the outside. Here it is with " instead of <>:

    [ Moderator note: It's the backtick or use the code button when you post. ]

    [testimonialswidget_list category=AZ "/code" meta_key=testimonials-widget-url hide_source=true hide_company=true hide_email=true hide_url=true]
  12. The code button is what you need to use or wrap text in the backtick character.

    Or use pastebin.com if that doesn't work.

  13. Michael Cannon
    Member
    Plugin Author

    Posted 1 year ago #

    Bob, think you can do WordPress > Tools > Export > Testimonials and send the file to me via http://typo3vagabond.com/contact-typo3vagabond/?

    Oh wait… are you saying that the shortcode is working as you want now?

  14. brdecloss
    Member
    Posted 1 year ago #

    Yes, it seems to be working now that I took out the < code > and < /code >

    Thanks. /Bob

  15. brdecloss
    Member
    Posted 1 year ago #

    I see there is an update 2.1.4, but the upgrade notices is blank. What are the changes and/or upgrades? Thanks. /Bob

  16. Michael Cannon
    Member
    Plugin Author

    Posted 1 year ago #

    You can usually find changes to plugins on the Changelog like http://wordpress.org/extend/plugins/testimonials-widget/changelog/.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags