[Resolved] Post format errors (only works in “standard”

Home Forums Support Post format errors (only works in “standard”

  • This topic has 7 replies, 3 voices, and was last updated 3 months ago by Tom.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1335110
    Joey

    I have recently migrated themes to premium GeneratePress and am running it off a child theme. I am having a couple errors when working in the post editor. If I change a post to any other format other than “standard”, such as “image,” “video,” “quote,” etc., the blog feed displays the image with the entire post. In other words, instead of just showing the image with an excerpt below it, or an image, or whatever it is supposed to do, it shows the image with the entire post below it.

    There is a similar issue with “Disable Elements.” When I try to disable a certain element with the editor, such as the header, the post preview does not display the changes. If, however, I publish or update the post, then the elements are disabled correctly.

    These are the only two issues I am finding. I mention them both in this post in case they are related, but the first issue is really what is affecting my ability to manage the site. Thank you.

    #1335213
    David
    Staff
    Customer Support

    Hi there,

    by default WordPress only provides the excerpt for the Standard Post format.
    We provide this filter to enable it for other requirements:

    https://docs.generatepress.com/article/generate_show_excerpt/

    You can use this code to enable excerpts on all formats:

    add_filter( 'generate_show_excerpt', function( $show ) {
        if ( 'standard' !== get_post_format() && ! $show ) {
            return true;
        }
    
        return $show;
    } );

    The Disable Elements issue – if this is related to an old themes template then i am unsure of the easiest way to cure that. Ill pass on to Tom.

    #1335567
    Tom
    Lead Developer
    Lead Developer

    The preview thing is a WordPress issue, as it’s not good at previewing post meta. It can either save post meta or not, and post meta isn’t saved when you preview a post (or else it would show on the live post). There might be some ways around it, but I’m not sure – I’ll do some digging.

    #1335809
    Joey

    Well my issue is that, for example, if I want to show just a photo in the blog feed, in my old theme I could just go to the editor and select “Post Format: Image”. And then it would show the image in the blog feed without an excerpt. If I wanted an excerpt, I could just select “Post Format: Standard” which is the default anyway.

    What happens now is that “Post Format: Standard” works just fine. But if I want the feed to only show an image, instead it displays the entire post.

    This might just be a wordpress issue, not a theme issue. I’m guessing then that the only way to get rid of the excerpt (or do quote, video, etc.) in the feed is to use CSS?

    #1335815
    Joey

    To Tom,

    No big deal about the preview, as that is more of a design element than something one uses a lot when creating posts on a live site. I was just confused because I was designing a section of the site from a page I was working on and then the preview wasn’t showing the removed elements. Took me a good 30 minutes to figure out a simple solution like clicking on “update”. As there were a couple bugs in the editor, I though I would ask about them together in case it is something related. Thanks for your help.

    #1336508
    Tom
    Lead Developer
    Lead Developer

    We don’t do anything special when it comes to the post formats, as that aspect of WordPress never really took off. Grabbing an image only requires some code that isn’t super performance-friendly.

    What I would suggest is using the more tag in your image posts: https://docs.generatepress.com/article/using-the-more-tag/

    That will make it so you can insert the tag after the image, and only the image will display in the excerpt.

    Otherwise, there is likely a function/filter we can utilize if you’d like.

    Let me know 🙂

    #1339702
    Joey

    Thank you to both of you. The more tag would would work, I didn’t think of that. To David, sorry if my question wasn’t clear, you’ve been a lot of help. Thanks again, JC

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