Cannot show Relationship Post Correctly – Template shows results for all posts
-
Hi,
I have used Pods to create a custom post type Agents and extend an existing post type Portfolio. Each portfolio is related to one agent while each agent can be related to more than projects.
I have been trying to use Pods templates and shortcode to show the related projects on the page of agents and vice versa.
However, the template returns values of all posts rather than one. See the attached link, the agent’s page shows the results for all agents.
My shortcode is as follows:
[pods name=”agent” template=”Related Project Template”]
The issue persists even if I choose add slug=”hammad-akhtar” in this shortcode.
My Template is as follows:
[if related_projects]
<ul style=”list-style: none;” class=”related-projects-css”>
[each related_projects]
<li style=”border-bottom: 1px solid black”>
<h3>{@post_title}</h3>
<p>Post Status: {@post_status}</p>
<p>Post Type: {@post_type}</p>
<p>Related Agent: {@related_agent}</p>[/each]
[else]
There are no projects associated with this agent.
[/if]I would really appreciate your help. I have been juggling with this issue for 4 days now. It’s a great plugin, however, this issue is a huge hurdle and is making it useless for me.
Thanks a lot,
Sana SahbanThe page I need help with: [log in to see the link]
- The topic ‘Cannot show Relationship Post Correctly – Template shows results for all posts’ is closed to new replies.