How to display featured image in Pages ?

Posted in: ionMag
Post count: 2

Hello, i don’t know if this option exist of if it must be writing in code but in my website, i don’t find the way to display the featured images in the pages. (like the blog articles).
Please help, i’ve many many pages in my website and i can’t to thas manually for all of them…

Congratulation for this amazing theme, i love it !

Alin V.
Post count: 288

Hi,

The theme doesn’t have an option to display the featured image on pages. If you set a featured image for your page it will appear only on modules(for example search template).
If you want to have the featured image also in your page content, you will need to modify the template you use. For example if you use the default template you can try to use the_post_thumbnail function – https://developer.wordpress.org/reference/functions/the_post_thumbnail/ I suppose you don’t use tagdiv composer on those pages, so they are like post, in this case here you can implement it – https://www.screencast.com/t/IISVOkXTBlu

Thanks!

Post count: 2

Thanks for your answer. I’ve created a new page model with the featured image. It’s perfect !

Post count: 9

It’s a helpful trick and it works perfectly.

It shows the featured image, but it doesn’t show the caption for the image.

How can i get the caption to be displayed on the page, underneath the image?

Thanks.

Catalin L.
Post count: 56

Hello Exculturae,

Provide your website so I can take a closer look at it. Provide some useful screenshots with your desired changes.

Thanks.

Post count: 9

Hello,

I’m developing a new website on a local server, on my computer.

Here’s a screenshot of the featured image and its caption on a post: https://ibb.co/dC8fqm

I added featured images on pages with the method described above, but it shows only the image. The caption underneath the image is missing: https://ibb.co/fe1YAm

Isn’t it possible to use the same method to import the featured image on posts and pages, in order to show the image and its caption?

Best regards,

Louis-Philippe

  • This reply was modified 2 weeks by  Exculturae.
Catalin L.
Post count: 56

Hello Louis-Philippe,

Unfortunately, this task involves doing a deeper debugging and we cannot provide custom work at the moment, sorry! You should check your custom added code and try to look for a caption and get it with a code. For more references, in this case, you should check the following useful topic here -> https://developer.wordpress.org/reference/functions/the_post_thumbnail/ -> https://stackoverflow.com/questions/1616281/is-there-a-function-to-get-the-caption-for-an-image-in-wordpress

Hope this helps!

Thanks for the message!

Post count: 9

Hello Catalin,

Thanks for your kind reply, it’s really appreciated.

I followed your suggestion to display featured image in pages:

<?php the_post_thumbnail(); ?>

I looked for a solution to display the caption, and figured out this one:

<div class="wp-caption-text">
<?php the_post_thumbnail_caption(); ?>
</div>

I inserted the code just below the previously mentioned line of code.

It works perfectly fine for me, and the caption is styled according to the default caption style.

Louis-Philippe

Viewing 8 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic.