Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Luuk Fiets

    (@luukfiets)

    Hi Jory,

    Thanks for getting back. After posting I read somewhere that indeed it saves the post ID instead of the text. I tried testing a few solutions, but didn’t get it to work with inserting an ID.

    However, your second solution did make sense. It lists the agencies like “Agency 1, Agency 2 and Agency 3”. Good to know that this is one way, but what I’d like to achieve is an unordered list with clickable agencies.

    So, my next step was to try the templates. I’ve set up a template with te following code in it:

    [each related_agencies]
    <a href="{@permalink,esc_url}"><p>{@post_title}</p></a>
    [/each]

    In the post of service A I’m calling the template with the following shortcode:
    [pods template="List all related agencies"]. This works as expected and gives back an unordered list with all related agencies including the a href tag. However, I would like to limit the number of results I’m getting back. Lets say I want a max of 3 agencies being listed. Unfortunately, adding limit="3" to the shortcode doesn’t work.

    If you can help me with figuring out how to get the related agencies when using post ID (instead of “Service A”), then I might be able to use that shortcode and try to limit that one, because that seems possible looking at the documentation.

    I think I’m getting there with something like this (32 = Service A):
    [pods name="services" limit="3" where="related_agencies.related_services.meta_value = '32'"][each related_service]{@permalink} is great![/each][/pods]

    Do you have any suggestions to limit the results to any number?

    Thread Starter Luuk Fiets

    (@luukfiets)

    Hi @keraweb

    Thanks for sharing. I changed the shortcode, but it gives me an error. The full shortcode I was using is below. Background information: Agency 1 is connected to Service A, so I’d like “Agency 1” to appear.
    [pods name="agency" where="t.related_services.meta_value = 'Service A' "]{@post_title}[/pods]

    The error I got was this one. I tried Google but didn’t find anything really useful. Someone suggested to use this_related_field.other_related_field.meta_value = ‘text here’ but that didn’t work either.
    Database Error; SQL: SELECT DISTINCTt.* FROMwp_postsAStWHERE ( ( t.related_services.meta_value = 'Service A' ) AND (t.post_type= "agency" ) AND (t.post_statusIN ( "publish" ) ) ) ORDER BYt.menu_order,t.post_title,t.post_dateLIMIT 0, 15; Response: Unknown column 't.related_services.meta_value' in 'where clause'

    Do you maybe have a suggestion for what I should try next or where I can find more (relevant) information?

    Thanks!

    • This reply was modified 5 years, 3 months ago by Luuk Fiets.
    • This reply was modified 5 years, 3 months ago by Luuk Fiets.
    Thread Starter Luuk Fiets

    (@luukfiets)

    I already forgot about this thread, but I forgot to set the tax indeed. Setting the tax for Belgium solved the problem ??

    Thread Starter Luuk Fiets

    (@luukfiets)

    Hi Pr,

    Thanks for helping out. After reading your message, I realize that I probably forgot to set tax for customers in Belgium. I will try to set the tax for Belgium as well. If it doesn’t work I’ll get back to you.

    Thanks again!

Viewing 4 replies - 1 through 4 (of 4 total)