Jump to content

How to display image from image field that has variations?


shogun
 Share

Recommended Posts

(Sorry for the dumb question. I'm just getting started.) I literally have an image field called "featured_image" with a limit of 1 image. Every time I try to output this image, it renders twice. It's driving me nuts. I don't get why.

<?php 
    echo page()->featured_image;
?>

the page outputs:

zara.png zara.png

Screen Shot 2019-12-07 at 9.50.10 PM.png

Screen Shot 2019-12-07 at 9.50.17 PM.png

Link to comment
Share on other sites

I deleted the blog profile I was playing with and setup the blank profile instead. It's outputting a single instance now as it should with:

<?php echo $page->featured_image->url; ?>

Maybe the default blog profile had some duplication going on at the top of the blog template that I wasn't aware of, (although I didn't see anything that indicated the code should repeat).

Either way, all good now! Thank you!

I'll most likely stick with the blank template anyway.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...