• Resolved Julie

    (@habannah)


    Hi Eliot,

    I’m trying to display links to taxonomy archives from anywhere on the site, not just posts. Within posts I would like to be able to link to taxonomies in which the post isn’t filed. So for example, I would like to be able to do something like this:

    [taxonomy tax_name value="term_name" field="title-link"]

    Although it would be great to be able to use id instead of value… Is anything like this possible? I’ve tried various methods and variations of code, including using <a> tags to wrap just the title field, but I can’t get anything to work unless I’m editing a post, and then I can only get all or current taxonomies to display.

    Thanks for your help!
    https://www.ads-software.com/plugins/custom-content-shortcode/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter Julie

    (@habannah)

    Hi again Eliot,

    As it turns out, my question before was a little too specific. I’m actually trying to figure out how to display any taxonomy field as I’ve also got custom fields attached to taxonomies. So I’m looking for something more like this to work:

    [content type="tax_name" id="id_number" field="field_name"]

    I actually tried to create my own shortcode to display my custom taxonomy fields, but the code I ended up using did something similar — it was just to automatically display the fields on the archive page. So I’m back at square 2 (I feel I’ve made some progress!).

    Any advice you can offer would be really appreciated!

    Plugin Author Eliot Akira

    (@miyarakira)

    My first thought was to do something like:

    <a href="[url site]/post_type/tax_name/[taxonomy tax_name out="slug"]/>
        [taxonomy tax_name]
    </a>

    ..which would link to an archive page for the same taxonomy as the current post. But, reading over your description, I see you want to link to taxonomies regardless of which one the current post is in.

    The feature you describe doesn’t exist yet, but it seems useful. One part I’m not clear about is “custom fields attached to taxonomies”. Is this achieved by a plugin you’re using?

    Thread Starter Julie

    (@habannah)

    Thanks Eliot. Yes, I wrote a custom plugin based on Tax Meta Class (I used this tutorial to write the plugin).

    That’s why I’m trying to create my own shortcode to display them, because I’m not sure if this will be supported by CCS and I didn’t want to ask you to add more functionality after you already added support for WCK for me (which I love so thanks again for that!). But since Tax Meta Class uses the WP Options table and not a meta data table, I thought maybe it would be easily done after all.

    If this is beyond the scope of CCS, I completely understand, though if you can hint me towards the right part of the codex to get the code I need to display my fields, that would be really cool ??

    But I do think that including the standard taxonomy fields in CCS would be awesome (slug, id, name, url, title-link, etc.). Thanks for considering this suggestion!

    Thread Starter Julie

    (@habannah)

    I’m going to have to set myself back at square 1 — it appears that Tax Meta Class doesn’t allow filtering or ordering based on the fields the class creates since the data is stored as a serialized array. I guess that’s why a data table might be better…

    Anyway, so my issue is back to the original, displaying standard taxonomy fields via CCS, which you’ve hinted you might be interested in supporting. If you do plan on implementing this, I’ll come back to mark this topic as resolved.

    Thanks!

    Plugin Author Eliot Akira

    (@miyarakira)

    With the latest update, you can display a taxonomy field like this:

    [taxonomy taxonomy_name term="4" field="description"]

    The term can be specified by ID or slug, and the field supports those created by Tax Meta Class.

    Thread Starter Julie

    (@habannah)

    You’re kidding me!!! Wow, Eliot, that’s amazing! I really wasn’t expecting support for Tax Meta Class. I’m so grateful! I donated a little something as a token of my appreciation. Wish it could have been more — you’re the best!!

    Thread Starter Julie

    (@habannah)

    Hi Eliot, sorry to bother you with this again, but I can’t seem to get custom taxonomy fields to display (the ones I created with Tax Meta Class). I’m not sure if it’s because they’re set up in a meta box (kind of like the wck custom fields), or maybe I need to input some code to make it work… Any advice? Thanks!

    (BTW, let me know if I should start a new thread for this — I wasn’t sure…)

    Thread Starter Julie

    (@habannah)

    Never mind, got things going ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Displaying Taxonomy Links Anywhere’ is closed to new replies.