Shortcode for GD listings sorted by custom fields

This topic contains 9 replies, has 2 voices, and was last updated by  Alex Rollin 5 years, 8 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #441383

    jotomas
    Buyer
    Post count: 802

    Hello,

    I am looking for the way to create a custom page with a page builder showing only specific listings sorted by custom fields, but I can not find a shortcode with parameters to do it.

    For example, I have a CPT for restaurants with a MultiSelect custom field with three options for restaurants participating in specific promotion campaigns (“Tapas Promotion Campaign”, “Paellas Promotion Campaign” and “Wine Lovers Promotion Campaign”), and I need a shortcode to show listings participating only in “Tapas Promotion Campaign”.

    In fact I have just reorganized my GD listings to use Custom Fields in this way, because I have found it a much more elegant and user friendly way than the way I used before, when I had the promotion campaigns as Categories and it was easy to set the shortcodes.

    Can you help?

    I look forward to your reply.

    Thank you very much for your help.

    Best regards.

    #441400

    Alex Rollin
    Moderator
    Post count: 27815

    It is not an easy thing to sort WP Arcives by custom fields, and the shortcodes and widgets offered by GD do not provide the feature.

    the GD_Listings shortcode is the most flexible, and we have documented all the params: https://wpgeodirectory.com/docs/core-shortcodes/#listings

    #441404

    jotomas
    Buyer
    Post count: 802

    Hi Alex,

    Just as I feared!

    Is this something that will be improved with GD V.2?

    I look forward to your reply.

    Thank you very much once again for your attention.

    Best regards.

    #441421

    Alex Rollin
    Moderator
    Post count: 27815

    No, this is not likely to change, as I understand it.

    You can add a feature request, though: https://wpgeodirectory.com/requests/

    Have you already tried using tags?

    #441433

    jotomas
    Buyer
    Post count: 802

    Hi Alex,

    Thank you very much for suggesting tags. I did not think about.

    Then, to use tags in the example I should set tags as follows:

    Tapas Promotion Campaign,Paellas Promotion Campaign,Wine Lovers Promotion Campaign

    and then use the GD Listings shortcode with tags filtering as follows:

    tags=”Tapas Promotion Campaign” or “Paellas Promotion Campaign” or “Wine Lovers Promotion Campaign”

    Would this be correct?

    I look forward to your reply.

    Thank you very much once again for your help.

    Best regards.

    #441441

    Alex Rollin
    Moderator
    Post count: 27815

    As far as I understand it yes that is correct.

    #441550

    jotomas
    Buyer
    Post count: 802

    Hi Alex,

    Thank you very much for your reply.

    I have tried as a tag “Els Dijous Tapas” but it did not work. Then I tried “dijoustapas” and it worked.

    Now I am unsure about which format tags should have to work: are spaces allowed? lower case and upper case are the same? which characters are allowed?

    Could you please point me to or supply some information?

    I look forward to your reply.

    Thank you very much once again for your help.

    Best regards.

    #441570

    Alex Rollin
    Moderator
    Post count: 27815

    Send over your details including the page URL where you are working on this, and a link to the tag itself so we can take a look at the title and the slug.

    Last I checked ‘Title’ should be used, not the slug, and caps and spaces should be allowed.

    #441636

    jotomas
    Buyer
    Post count: 802
    This reply has been marked as private.
    #441651

    Alex Rollin
    Moderator
    Post count: 27815

    Excellent!

    Could have been a formatting issue.

    Glad it works! 🙂

Viewing 10 posts - 1 through 10 (of 10 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket