We're merging with GenerateBlocks! Learn more here.

[Resolved] Read More Only if There’s a More Block

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Read More Only if There’s a More Block

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #23029
    Jane
    Participant

    Hi, I’m hoping you can help.

    I’ve set up a WP Show Posts list with Content Type set to “Full”.

    When editing my posts, I include a More Block to determine where to cut off the post and display the “Read More” link in WP Show Posts. That works perfectly, but for very short posts I don’t want to include a More Block; I just want to display the entire post. The whole post is displayed by WPSP but there is a “Read More” link at the bottom, which doesn’t really make sense as there is no more content to read.

    Is there a way I can show the “Read More” link only for posts that have a More Block, please?

    #23184
    Tom
    Keymaster

    Hi Jane,

    Tricky one (although it shouldn’t be).

    Out of curiosity, what happens if you:

    1. Disable the read more button in your list.
    2. Add this snippet:

    remove_filter( 'excerpt_more', 'wpsp_excerpt_more', 999 );

    Anything at all?

    #23304
    Jane
    Participant

    That doesn’t seem to have done anything unfortunately.

    I just have no read more buttons now.

    The GeneratePress category archive is fine – the posts with More Blocks in have buttons and the ones without don’t. But the WP Show Posts list seems to have to either have a button or not have a button for all posts regardless of whether they are displaying the full content, or the full content up as far as a More Block.

    It’s not urgent. Maybe you could have another think after the weekend.

    #23525
    Tom
    Keymaster

    Hmm, any chance you can link me to a GP archive that has the functionality you want, and to the WPSP archive that’s missing it? It might give me an idea 🙂

    #23546
    Jane
    Participant

    The Latest News here https://buckbylibraryhub.org/ is a WP Show Posts List picking up the category “Featured News”.

    Then, this is the category archive https://buckbylibraryhub.org/category/featured-news/

    I am using the generate_more-jump filter to make “read more” go to the top of the blog post, but I wouldn’t have thought that would be relevant. Just mentioning in case.

    #23649
    Tom
    Keymaster

    Can you update to our development version and then try the filter below?: https://wpshowposts.com/wp-show-posts-1-2-0/

    add_filter( 'wpsp_content_more_link', '__return_null' );

    Any difference at all?

    #23703
    Jane
    Participant

    Thanks, Tom. It looks like that might have done the trick!

    I’ve put the alpha version on a test site, added the filter and then removed the “Read More” text from the WP Show Posts list.

    I now have the behaviour I was looking for. 🙂 As at today, you can see it here on my very ugly test site https://sandbox.janeb.co.uk/ although that page will not stay like that for long.

    I’ll probably hold off installing it on the live site for now, but it’s good to know a solution is on it’s way.

    Thank you for looking into this.

    #23780
    Tom
    Keymaster

    It’s likely more of a beta than an alpha at this point – haven’t found many issues. Plan on pushing out the official version early 2021 🙂

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