Site logo

Archived topic

Use ACF to add a logo overlay to Generatepress Post Image

5 replies · Started by Jordan on April 20, 2021

Viewing posts 1–6 of 6

Hey there, trying to figure out something pretty custom -- this might be a question for an ACF forum but thought I'd start here.

I'm working in a custom post type, using WP Show Posts to display them and my goal is to have a background image (default featured) and then a foreground logo (thinking ACF is probably the way to do this). I'm just not sure how to loop in the php from ACF to get it to display sitewide paired with the original thumbnail. Once I figure that out I can style accordingly.

Any help would be appreciated!

Theme: Generatepress child
Post grid: WP Show Posts
Page: bonemaro.com/work

Hi there,

I'm not exactly sure I fully get the whole picture.

Can you share any mockups of how you want it to look like?

Perhaps you can link us to a reference site you want to replicate? Let us know.

Sorry I wasn't super clear. The goal is to have 2 featured images that display instead of one.

If you go to this page bonemaro.com/work you'll see the last entry has a looping gif that says "West". Instead of making a GIF and setting that as the featured image. I would love it if I could set the featured image as the black and white background you see...but then in a custom field add another logo image or logo svg to stack on top of the background -- thus having independent control, smaller file sizes, and the ability to animate logos without having to upload heavy gifs.

The result is to look the same as the "West" example.

I think I can do this with ACF and their image field. But I've tried a few places in the php to insert , and can't figure out how to display the custom image field with the standard featured image. I'm using the WP Show Post plugin to display projects across the site.

https://www.advancedcustomfields.com/resources/image/

Ah I see.

This isn't exactly a GeneratePress question. (wpsp has its own support forum, https://wpshowposts.com/support/area/pro-support/)

But to help you out:

You can use the hooks provided here.
https://wpshowposts.com/support/topic/bbpress-metadata-and-dates-in-wpshowposts/#post-28854

The most appropriate one would be wpsp_inside_image_container.

Example:

add_action('wpsp_inside_image_container',function(){
echo get_field( "your_image_field", get_the_ID() );
});

I'm not exactly sure what data your ACF stores. The code I've provided may either show a URL string, or an actual rendered HTML depending on how you've set it up.

And this is only or adding another featured image.

What you're trying to do seems to require custom script. That's outside of our scope, unfortunately.

Hey Elvin, thanks for the guidance! Apologies for not utilizing the correct forum. You guys are so awesome -- so I appreciate the input. I'll follow up on their forum if I need more WPSP support.

Cheers!

I answer for WPSP too anyway. We just prefer separating things to both forums don't get convoluted.

No problem. :)

This archived topic is closed to new replies.