Cyber Week Sale! Get $20 off GP Premium, $40 off our new Lifetime license, and 45% off license renewals/extensions! Learn more

[Resolved] Blog Page broken after update to 1.2.9

Home Forums Support Blog Page broken after update to 1.2.9

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #86882
    Thomas Connertz

    Hi Tom,
    I have purchased the Premium package a few weeks ago. Blog Addon is activated, Blog content option set to “show excerpt only” (not sure what it exactly is in English because I’m using the German translation). Everything worked fine with 1.2.8. I just updated to 1.2.9, did not change any options. But now the blog page is not displaying the excerpt, but all content (up to the more-tag).
    Website is http://dreiminutenei.de (german language foodie blog).
    Can I switch back to 1.2.8 until that’s fixed? Or add some lines of code (through the code snippets plugin)?
    Thanks for your help.
    Best,
    Thomas

    #86883
    Tom
    Lead Developer
    Lead Developer

    Hi Thomas,

    This is actually intended.

    I wanted to give people the option to use excerpts, but still be able to use the read more tag if they like for specific posts. I had quite a few people ask me why the more tag wasn’t working, and it was because they had excerpts set. This way, there’s more choice for the user.

    If you only want to show the standard excerpt, why use the more tag?

    Let me know 🙂

    #86886
    Thomas Connertz

    I switched over to generatepress from another theme, made some design decisions after switching. Don’t want to have to delete the more-tags from about 250 posts that are already online.
    It’s nice to have options, so why not let people choose between three (excerpt only, everything up the more tag, all content)?
    BTW: switching to “show all content” doesn’t seem to change anything.

    #86887
    Tom
    Lead Developer
    Lead Developer

    Hmm, I see what you mean.

    The way it is now, people do have options – they can:

    a) Show excerpts, while choosing to display more using the read more tag
    b) Show full posts, while choosing to cut off the post using the read more tag

    There was a couple cases I found where people needed to use the read more tag on some posts, but not all, but didn’t want the full post showing for the posts they didn’t want to use the read more tag on.

    So here’s what you can do:

    1. Create a child theme: http://generatepress.com/api/themes/generatepress_child.zip
    2. Add this file to your child theme: https://gist.github.com/generatepress/02e4a79caa0f8a5db7dc

    You have to name it content.php, and it must be placed in your child theme folder.

    Basically, this is a copy of the theme’s content.php file, but we set the $more_tag variable to false so it will ignore any more tags you have.

    The only thing with this is you won’t receive updated content.php files when I update the theme, so it’s worth checking out the new content.php files now and then to make sure it’s all updated.

    Hope this helps 🙂

    #86910
    Tom
    Lead Developer
    Lead Developer

    Ok, here’s what I’ve done.

    In the next version of GP you’ll be able to delete the file above in your child theme and will be able to set the $more_tag to false using a filter.

    I’ll post the code to use in here once the new version is released.

    Thanks! 🙂

    #86911
    Thomas Connertz

    Tom,

    That helped.

    So, with future updates I have to do the following:

    1. copy the updated content.php file to my child theme folder
    2. set $more_tag = false; if that’s not already the case

    Although that does not seem to be too complicated, it’s not the most elegant solution.

    And I have to admit I’m not really happy with the update policy: changing the behavior of the theme without letting people know in advance.

    Anyway, it’s still a great theme. And thanks for your fast help.
    Thomas

    #86914
    Tom
    Lead Developer
    Lead Developer

    With the next update, you’ll have to add some code like this to your child theme’s functions.php file:

    add_filter('generate_more_tag','generate_disable_more_tag');
    function generate_disable_more_tag()
    {
          return false;
    }

    Then you’ll never have to do anything again.

    For now, you can set the $more_tag in content.php to false.

    In the changelog, you’ll find this line:

    Show read more link when using more tag, even when blog content is set to show excerpts

    GeneratePress is still quite young, so things will change from time to time (not dramatically). This was a feature I’ve had a few people ask for, so I went for it.

    That being said, I want to please everyone, which is why I always provide a workaround, and in this case a new filter to meet your needs (and maybe others).

    Sorry for the inconvenience.

    #86916
    Thomas Connertz

    Sorry if I’ve been too blunt – that’s probably my German English. You’ve been very helpful. I appreciate that.
    Adding another filter to the child theme’s functions.php seems like a good solution. Using a plugin like Code Snippets would not even require that – if one would want to rely on a plugin …

    #86920
    Tom
    Lead Developer
    Lead Developer

    No problem! It’s annoying when updates change things that you don’t want changed.

    Having a functions.php file in your child theme is definitely a good idea – I prefer it over using Code Snippets.

    You could actually do the following right now and never think about this again:

    1. Open the content.php file in the generatepress folder.
    2. Find this line: $more_tag = @strpos( $post->post_content, '<!--more-->');
    3. Replace it with this: $more_tag = apply_filters( 'generate_more_tag', @strpos( $post->post_content, '<!--more-->') );
    4. Now add the function from my previous post to your child theme, and you’re done!

    #86923
    Thomas Connertz

    Thanks again.
    I’ll try this tomorrow and let you know if it worked. (It’s almost midnight here.)

    #86924
    Tom
    Lead Developer
    Lead Developer
    #87044
    fevzi

    Hello. Programs that I have bought from you, Version: 1.2.9
    About the Author: Tom Usborne
    Website: Embarrassed Press. does not work well. I can not organize my website that I want.

    Can you help me what’s happened?

    Fevzi Yalcin

    #87055
    Thomas Connertz

    Added the code Tom gave in the posts above. Works fine.
    Thanks a lot.
    Thomas

    #87084
    Tom
    Lead Developer
    Lead Developer

    Fevzi – absolutely, can you start your own topic and explain exactly what’s not working well so I can help you figure it out?

    Thomas – awesome, you’re welcome! 🙂

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