integrate a custom fiel image inside a posts loop widget or a post sidebar widget ?
Hello,
I’m trying to display posts with title, excerpt and…an image from a custom field.
I tried to integrate the image instead of the featured image.
I didn’t found a solution with the sidebar widget wich worked fitted perfectly my need except for the image.
I should probably use The post loop widget but I don’t find the code of the query I should integrate.
This is our free support forum. Replies can take several days.
Need fast email support? Get SiteOrigin Premium
Replies
1Hi Gabriel
My guess is that you should create a child theme and within that create your own loop for the Post Loop widget to use.
Within your child theme create a folder called loops. Then assuming the Blog loop template worked for you, copy that over to your child theme loops folder, loop-blog.php. Then edit loop-blog.php and replace lines 6 through 21 with the contents of content.php, lines 11 through 55.
To summarise, loop-blog.php uses content.php which calls the featured image. So we’re creating a child theme. Putting a copy of loop-blog.php in the loops folder so it overrides the original. Then we’re coping most of content.php into our new loop-blog.php file. Once that’s done replace lines 24 to 28 in loop-blog.php with your own custom field image.
Let me know.
Replies on this thread are closed.
Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.