[Resolved] How to hide featured images or strip formatting from excerpt

Home Forums Support [Resolved] How to hide featured images or strip formatting from excerpt

Home Forums Support How to hide featured images or strip formatting from excerpt

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #122115
    Luis

    Hi Tom,

    First of all I want to congratulate you on making such a great theme with such awesome support.

    I’m currently working redesigning a site but I’m having trouble getting the homepage looking right. My first approach was to show the featured image with an excerpt from the post showing but the problem is that the featured image is also included in the first paragraph of the content. This means that the image would appear twice on the homepage for each blog post. Is there any way to strip the HTML from the excerpts shown in this area? I’m currently hiding the featured image so that it doesn’t duplicate.

    The second question is: even though I’ve selected to hide the featured image it is still showing up above the header in the actual blog posts. I thought this might be a caching issue but I’ve emptied the cache, cleared my browser’s content and did a full reload of the page. I can’t get rid of the featured image on the blog post itself.

    Thank you for your help!

    #122167
    Tom
    Lead Developer
    Lead Developer

    Hi Luis,

    To strip formatting from the Excerpt, set the blog post content option to show the excerpt instead of the full post in “Customize > Blog > Blog Content”.

    To remove the featured image on the single blog post, you can add this CSS:

    .single .page-header-image-single {
          display: none;
    }

    Let me know if you need more info πŸ™‚

    #122544
    Luis

    Hi Tom,

    Thanks so much for your quick response. I was able to find the solution to the HTML in the excerpt in another one of your support threads: http://generatepress.com/forums/topic/blog-excerpt-length-not-working/#post-122509. I just had to disable the MORE tag and it worked like a charm.

    I also used your CSS solution to hide the featured image in the single blog posts. While it does the trick, I was hoping to completely prevent the image from loading at all to reduce download times. Is there no option to disable it from the theme customizer? If not, what would I need to do to implement this in my child theme?

    I really appreciate your help. I bought the theme extensions pack and it really opens up so many possibilities with the great theme you’ve created.

    Cheers!

    #122565
    Tom
    Lead Developer
    Lead Developer

    You can definitely prevent the featured image from being on the single page using some PHP – do you have the Page Header add-on enabled?

    #122800
    Luis

    Yes, I do.

    #122822
    Tom
    Lead Developer
    Lead Developer

    Try adding this function:

    add_action( 'init','generate_remove_single_page_header' );
    function generate_remove_single_page_header()
    {
          remove_action('generate_before_content','generate_page_header_single', 10);
    }

    Let me know if that does it or not πŸ™‚

    #122860
    Luis

    Thank you, that worked like a charm.

    You’re the best, Tom!

    #122875
    Tom
    Lead Developer
    Lead Developer

    Awesome, happy to help! πŸ™‚

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