How to make layout for single item of loop

Hi there. I want to replace layout of each single post which appear on archive page.
I want to use archive layout of my theme, I only want to replace each archive loop item layout with custom one using Loop & Logic my wordpress theme has built in option for replacing archive items with custom designs.
Screenshop explains more. I want only highlighted part generated by loop and logic template not the whole archive layout.

I do that by calling the template with a variable set to the post slug
[template id=12345 postid=poodle]

Then the loop in the template looks like
<Loop type="dogs" id="{Get local=postid}">

Disclaimer: I’m far from being a theme developer. If my understanding of what you’re trying to achieve is correct, that archive page you currently have is being generated by one of your theme’s template files and you want to piggyback on the query loop from that template (the one that’s getting all the post data) and then use L&L to change the layout of each individual item. Is that right? Editing PHP template files is way out of my depths, but the docs seem to indicate that it’s theoretically possible to reference an L&L template in PHP. So I assume that would involve going into the template file, removing the PHP that references the post content and replacing it with a function that references your L&L template. Alternatively, it might be easier to create an L&L template that loops through the posts and styles it and then you could replace the whole post loop from the template file with your L&L template.

If you’re anything like me, you’re using L&L to get away from having to edit PHP files in the first place, so it’s probably easiest to instead create this page using L&L and the builder of your choice instead of needing to touch PHP. That’s what I’d do. Hope that’s helpful!

1 Like