Site logo

Archived topic

PODS and CPT archive templates

11 replies · Started by Sean on October 26, 2020

Viewing posts 1–12 of 12

I am trying to build a staff directory with PODS and am having issues with the rendering of post archive pages.

What I have so far:

Custom post type called Staff Member
PODS template called Staff Member - this correctly shows a few fields including a photo: http://demo.brandsavvy.co.uk/staff-member/john-smith/
PODS template called Staff Member Archive - this refuses to show the image (I can pull in the image URL though) or any HTML formatting (in the example page 'Location' has strong and there is a <br> after each line: http://demo.brandsavvy.co.uk/staff-member/

If I change the template to TwentySeventeen, for example, the PODS template works: https://ibb.co/xggYXpC

I've tried with the GeneratePress Premium plugin disabled and the onlt other plugin I have installed is PODS.

Any idea what's happening?

Thanks!

Thanks for the response Leo

Unfortunately not. I'm not using a featured image either - it's a field in the custom post type created with PODS.

I have the following in the PODS template:

<ul class="staff-list">
<li><img class="staff-image" src="{@photo._src}" />
<div>{@first_name} {@last_name}</div>
[if location]<div><strong>Location:</strong> {@location}</div>[/if]
</li>
</ul>
<br>
{@photo._src}

That last {@photo._src} displays the image URL OK.

None of the HTML styling is being rendered in the page at all. But if I use another theme then it does!

Hi there,

in your Pods template - do you have Archives Enabled - i believe its under the Advanced settings.

Hi David

Yes, in the Staff Member POD the Archive is enabled and the Archive View Template is set to the correct template.

Hi there,

I'm not familiar enough with how PODs works when it comes to overwriting templates like this. Do they have any documentation on what's required on the themes part in order for this to work?

Hi Tom

Neither am I! Only started using it last week!

All I found in the docs was this: https://docs.pods.io/themes/

I'm using the PODS template to override the theme templates at the moment - but I am going to try and do it by editing archive.php in a child theme later if I can't get it to work.

Thanks

Have you tried PODs support ? Jim True is great and has experience with the GeneratePress. He may have a quick answer. As currently it looks like your PODs template is being output as the summary excerpt which by default would strip the HTML.

Hi David

I have asked on their Wordpress.org support but no joy there yet.

I have just had a look at the settings in the Auto Template options tab and both the Single Template and Archive Template Filters were set to 'the_content'

Just out of interest I changed the archive filter to 'the_excerpt' and it now works!

So thanks!!

Awesome - glad i was of some help!

PODS support have also said that the filter value may be different on certain themes - does the same on Twenty Nineteen!

I thought it would be quite common. Thanks for feeding back!

This archived topic is closed to new replies.