• Resolved seank123

    (@seank123)


    I have two custom post:

    Location
    Staff Member

    I have set up the following PODS templates:

    Staff Member – this show the fields in the Staff Member custom post correctly
    Staff Member Archive – this lists fields from the the posts in the Staff Member post type
    Location – this shows the fields in the Location post type correctly

    What I would like is to have the Staff Member posts listed in the Location template. I have tried the following:

    [pods name=”staff_member” template=”staff_member_archive” limit=”5″][/pods]
    [pods name=”staff_member” id=”61″]{@first_name} is great![/pods]
    [pods name=”staff_member” slug=”john-smith”]{@first_name} is great![/pods]

    But all return nothing but the ‘is great!’ text

    What am I missing?

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hello @seank123

    I assume the staff_member Pod is a custom post type?
    Could you try {@title} and let me know if that displays anything?

    Cheers, Jory

    Thread Starter seank123

    (@seank123)

    Thanks

    Yes, that’s right, staff_member is the custom post type.

    [pods name=”staff_member” slug=”john-smith”]{{@title}} is great![/pods] gives me:

    ‘Retford is great!’

    Retford is the title of the Location page I am on (Location is another custom post type – so the page is: mydomain.co.uk/location/retford)

    Plugin Author Jory Hogeveen

    (@keraweb)

    Are you using this shortcode within a Pods Template?
    If so, you’ll need to create a separate template file:

    https://docs.pods.io/displaying-pods/pods-shortcode/

    Note: When using this shortcode within Pods templates you cannot use it as a nested shortcode since the magic tags will be parsed before parsing the shortcode. You will need to use the template parameter.

    Cheers, Jory

    Thread Starter seank123

    (@seank123)

    Ended up doing it with php and adding it as a hook!

    Plugin Author Jory Hogeveen

    (@keraweb)

    Perfect!

    @seank123

    If possible, can you provide more details on the solution that you developed and implemented?

    Your solution may be useful and applicable to others facing a similar issue.

    Thanks.

    JJCI

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘List of custom posts in a PODS Template’ is closed to new replies.