Forum Replies Created

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

    (@ashishonl)

    okay so I found a solution myself. I’m posting my solution here so it can be helpful for someone else who is stuck in a similar situation where he wants to fetch the custom taxonomies from a post and wants to display them in a particular manner.

    As I explained in my last reply, using the shortcode [pods]{@taxonomy_name[/pods] was already fetching the desired (i.e. associated) taxonomies from current post, the only issue was that I needed to display the taxonomies in a particular manner (i.e. along with their respective icons that I had added to them through a custom image field. So here is what I did:
    Instead of inserting the Pods template into the shortcode, I directly called the icon field in my like this: [pods]{@taxonomy_name.custom_img_field_name._img}[/pods].

    This started displaying the icons of all those taxonomies which I had tagged with the post. Next part was putting the names of taxonomies next to these icons, which I did by using the each relationship loops:

    [pods][each taxonomy-name]
    <div>{@taxonomy_name.custom_img_field_name._img}&nbsp {@taxonomy_name.name}</div>[/each][/pods]

    As you can see, I have created a div inside the each relationship loop and inside that div I have firstly inserted the shortcode to fetch the image from custom field of each taxonomy, and then after that I have put the shortcode for fetching the title field oof each taxonomy, before closing the div as well as each loop.

    You can also use other HTML styling elements like &nbsp etc. and custom CSS to stylize the way how your taxonomies are displayed.

    Thread Starter ashishonl

    (@ashishonl)

    Hi,
    Putting in this shortcode allows me to fetch the exact amenities that are tagged with the post:
    [pods]{@amenity}[/pods]

    However, this shortcode gives me a plain-text output of the amenities. I want the amenities to be displayed according to a Pods template that I have defined, so they appear with their corresponding icons… now only thing I need is a method to pass the value of template in this above given shortcode.

    Thread Starter ashishonl

    (@ashishonl)

    Hi @keraweb
    Thanks for your response. Eliminating the name parameter is not helping. So I guess I need to use the id parameter in order to do this thing. My question is – how do I instruct the shortcode to fetch the ID of the current post? I can’t insert the ID of any particular post in the shortcode as I want each property page to display the amenities that are tagged with it, so the shortcode must be formatted in such a manner that it fetches the ID of current post automatically. How to do that?

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