Archived topic
Can I use Elements to Style Pods Posts
7 replies · Started by troyw on September 9, 2021
Hi team,
I need to create styling for Pods Custom Posts and thought I could use the Layout Element to do this. However having now tried this, I don't think it is possible this way. I created a Layout Element and set the Display Rule Location to 'Release' and 'All Releases'.
What I do find strange is that I have also set the same Display Rule to my Release Archive Header Element and it doesn't apply a Header to the Release Posts, only to the Release Archive?
So my first question is, why does the Header Element not work for the Release Posts?
Lastly, can I use an Element or any other GP tools to style the Pods Custom Posts and if so, can you point me to some documentation or video to show me how?
Thanks
Hi there,
Layout Elements should work on custom post types.
First thing to check is if there's a conflicting layout element.
Say, for example. You have a Layout element w/ a display rule location of "Entire site". If you made another layout element for "Release", the 2 layout elements will conflict because "Release" is technically a part of "Entire site". In cases like this, you'll have to set Display rule exclusions or just make display rules location for multiple layout elements, more specific.
Lastly, can I use an Element or any other GP tools to style the Pods Custom Posts and if so, can you point me to some documentation or video to show me how?
I'm not sure if PoDs create its own post layout template. If it does, Block Element - Content template will likely not work on it because this particular feature only applies to the default theme layout. :)
Hey Elvin,
I'm pretty sure that Pods does not create its own layouts, which is pretty rubbish to be honest. Seems to defeat the purpose of plugin when you need to be a full on coder to make it work on the front end. If one is a coder, they would probably code it and not use a plugin at all.
So if Pods does not, then I should be able to get the Elements to style it. I'll keep looking.
Anyway, found the conflicting element and Header now works.
Thanks
Do you have a child theme template for "Release" CPT? that can prevent content templates from applying as well.
Normally, a single post layout's content will be inside an <article> element. Your site's "Release" posts aren't in one.
I'm not exactly sure if that's from a child theme template or it's actually a block element - content template applying a different layout.
Anyway, I will look for any conflicting elements, but the other strange thing is that I have assigned a Header Element to the ‘Release’ Posts and it does not work. Yet the Element works on the Release Archive. That doesn’t make sense?
Not sure what you mean. I see the same page-hero (Header element) on the pages you've provided as shown here - https://share.getcloudapp.com/o0uPYmL8
So sorry Elvin,
I fixed the Header issue just before you responded, so Header Element is all good now.
This is the content of the Child Theme: single-release.php
<div class="release-artists">
<?php foreach(vicious_get_release_artist(get_the_ID()) as $artist) : ?>
<span class="artist"><a href="<?php echo get_permalink( $artist['ID'] ); ?>"><?php echo $artist['post_title']; ?></a></span>
<?php endforeach; ?>
</div>
Would this conflict with your Elements?
Assuming that I should be able to use Elements to style custom posts as the Layout now adds side bars, how would I go about the actual styling. Would I use just us Block Elements?
All good, I have finally got it. Block Element with Page Hero seems to be it.
Thanks Elvin.
If the main issue is the side bars, you can remove that w/ a layout element as well.
But you seem to have it sorted. Thanks for letting us know. No problem. :D