[Resolved] Featured image is not displayed on single post page

Home Forums Support [Resolved] Featured image is not displayed on single post page

Home Forums Support Featured image is not displayed on single post page

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #524666
    Dave

    The featured image is working fine on with front page list, but not on the single post item. The “Disable Elements” feature is not activated. The box is checked to “Display featured images” in the customizer under layout/blog/featured image on the post tab.

    Thanks for any help

    GeneratePress 2.0.2
    #524758
    Leo
    Staff
    Customer Support

    Hi there,

    Looks like you’ve figured out? I can see the featured image no problem:
    2018-03-20_1103.png

    #524785
    Dave

    Hi Leo,

    The issue is not corrected yet. The screen grab you show doesn’t have the featured image. If you go to the home page, the featured images are displaying in the list of post correctly. But when you click the link to the single post the featured images are not displaying on the single page. This is the issue.

    Thanks,
    Dave

    #524838
    Leo
    Staff
    Customer Support

    Are you wanting to use featured image and page header at the same time?

    #530527
    Dave

    Yes, I want to page header, the post title, the featured image, and then the post text. I have the “display feature images” checked in the customizer, blog, layout for post area. If you go to the home page the header featured images displays fine, but if you click the post to load a single post the featured image is not displayed but I would like it there also.

    Thanks,
    Dave

    #530587
    Tom
    Lead Developer
    Lead Developer

    Right now the Page Header replaces the featured image on single posts and pages. We’re working on separating the two so they can be displayed at the same time.

    For now, you can do something like this: https://generatepress.com/forums/topic/featured-image-does-not-appears-in-indivual-post/page/2/#post-525114

    Let me know if this helps or not 🙂

    #531147
    Dave

    Hi Tom,

    Thanks for your speedy response on a Sunday evening. I’m impressed. I tried using the code (below) in the “additional CSS area of the customizer, but it was showing 6 errors and I wasn’t able to save it. Then I tried using a child theme and added the code to the style.css file. It did nothing.

    If you working on the better solution in the works, I guess I can wait. But if you have another suggestion using css please let me know.

    Thanks,
    Dave

    add_action( ‘generate_after_content’, ‘tu_add_featured_image’ );
    function tu_add_featured_image() {
    if ( has_post_thumbnail() && is_singular() ) {
    the_post_thumbnail();
    }
    }

    #531266
    Leo
    Staff
    Customer Support

    That’s PHP code so try one of these methods: https://docs.generatepress.com/article/adding-php/

    Code snippets is the easiest if you aren’t using a child theme.

    #531292
    Dave

    Hi Leo,

    Yes, the code is working. Thank you. I would like one adjustment if possible. Could the featured image be inserted after the title and before the text of the post ( on the single post page only)? So the elements on the single post page would be the header, the post title, the date, the featured image, and then the post text.

    If there is an easy fix I would be very happy. I’m happy now just to have the featured image on the post page.

    Thanks again,
    Dave

    #531391
    Tom
    Lead Developer
    Lead Developer

    Absolutely! Instead of:

    add_action( 'generate_after_content', 'tu_add_featured_image' );

    Do this:

    add_action( 'generate_after_entry_header', 'tu_add_featured_image' );

    #531407
    Dave

    Hi Tom,

    Thank you, Thank you. Your code change is exactly what I wanted. Great theme and great support! I’m glad I purchased the upgrade to Premium.

    Dave

    #531968
    Tom
    Lead Developer
    Lead Developer

    Thanks! Glad I could help 🙂

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