Tagged: advanced layout builder, Custom Post Type, loop, Shortcodes
I’ve created a custom content part in my child theme, using the Blog Post content part and created a subtly modified part called Resource Part. This lives in /shortcodes/resource with resource.css and resource.php. This is working correctly for me in the Advanced Layout Builder.
Inside my theme directory, I’ve created a file single-resource.php and it is being accessed correctly to display a page for the resource custom post type.
I’m trying to create a custom loop file that Resource Part uses instead of the regular blog loop when the Resource Part is used on a Page. I’ve created a file inside /includes called loop-resource.php that is a modified copy of loop-index.php. I’ve changed all instances of where a post_type is defined as a ‘post’ to ‘resource’ (the name of my custom post type).
In single-resource.php I’ve modified the following: get_template_part( 'includes/loop', 'resource ');
When I place my new Resource Part content item on a Page using the ALB, is loop-resource.php the file that it’s supposed to be using? I could use some help knowing a few more facts about the file structure.
I’m trying to create a custom loop for my Resource Part, so I can add custom fields, etc to control its display more granularly than the default Blog post loop. Am I even modifying the right file?
I’m almost there. Just need a bit more help.