• Resolved gestad2019

    (@gestad2019)


    Hi,

    we’re very happy to use the power of Pods in our Elementor websites and enjoy discover the many functionalities.

    I am now working on a website where I need to select content for a CPT according to a taxonomy. It might sounds weird but I have CPT (because I need it for other reasons) for Airplane Companies (company A, company B) called menu with custom fields and a taxonomy for companies (company A, company B) also with custom fields called company and the field name is called nom_compagnie.
    I need to show on the page for Company A posts that use the taxonomy term related to the company A.

    I’ve also created a relationship between the CPT and the taxonomy.

    I’ve read the documentation and several posts on the forum but couldn’t find a working solution to create my shortcode.

    I need it to be dynamical so according to the Company selected from menu, the content is specific to this company.

    This is a selection (my best tries I guess) that I tried without success
    [pods name=”menu” where=”taxonomy_name.slug = ‘compagnie’ and field.name = ‘nom_compagnie’ “][/pods]
    [pods name=”menu” where=”taxonomy_name.slug = ‘compagnie’ and ‘term_id’ = 8463 “]{@post_title}[/pods]

    Does something lack? like the field name for the company CPT? How can I match them together? Can I use “and” operator and how?

    thanks for your help

    Guillaume

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter gestad2019

    (@gestad2019)

    I think I’m getting closer to my goal. I’ve created a short code this way

    [pods name="compagnie" nom_compagnie.slug="{@permalink}" template="single-page-8628"]

    I’ve also tried with a condition

    [pods name="compagnie" where "nom_compagnie.slug = {@permalink}" template="single-page-8628"]

    I want to show posts according to a certain taxonomy – here ‘compagnie‘ – and according to a certain field – here ‘nom_compagnie.slug‘ – but the slug’s term should be dynamical and get from the post slug or permalink (according to here)

    It doesn’t show any thing yet, could that work?

    • This reply was modified 1 year, 9 months ago by gestad2019.
    • This reply was modified 1 year, 9 months ago by gestad2019.
    Plugin Support Paul Clark

    (@pdclark)

    In order to use magic tags like {@permalink} in shortcode parameters, one must set define( 'PODS_SHORTCODE_ALLOW_EVALUATE_TAGS', true ); in wp-config.php

    Thread Starter gestad2019

    (@gestad2019)

    ok thanks Paul, we’ll try

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Mix CPT and Taxonomies’ is closed to new replies.