Home>Support>integrate a custom fiel image inside a posts loop widget or a post sidebar widget ?

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. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 6 years, 12 days ago Andrew Misplon Hi, I Work Here

    Hi 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.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More