- This topic has 13 replies, 3 voices, and was last updated 9 years, 6 months ago by Tom.
-
AuthorPosts
-
March 14, 2015 at 11:47 am #86882Thomas 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,
ThomasMarch 14, 2015 at 11:52 am #86883TomLead DeveloperLead DeveloperHi 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 π
March 14, 2015 at 12:00 pm #86886Thomas ConnertzI 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.March 14, 2015 at 12:08 pm #86887TomLead DeveloperLead DeveloperHmm, 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 tagThere 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/02e4a79caa0f8a5db7dcYou 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 π
March 14, 2015 at 12:45 pm #86910TomLead DeveloperLead DeveloperOk, 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! π
March 14, 2015 at 1:06 pm #86911Thomas ConnertzTom,
That helped.
So, with future updates I have to do the following:
- copy the updated content.php file to my child theme folder
- 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.
ThomasMarch 14, 2015 at 1:33 pm #86914TomLead DeveloperLead DeveloperWith 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.
March 14, 2015 at 2:11 pm #86916Thomas ConnertzSorry 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 …March 14, 2015 at 2:18 pm #86920TomLead DeveloperLead DeveloperNo 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!March 14, 2015 at 2:36 pm #86923Thomas ConnertzThanks again.
I’ll try this tomorrow and let you know if it worked. (It’s almost midnight here.)March 14, 2015 at 2:38 pm #86924TomLead DeveloperLead DeveloperNo problem! π
March 15, 2015 at 4:50 am #87044fevziHello. 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
March 15, 2015 at 8:00 am #87055Thomas ConnertzAdded the code Tom gave in the posts above. Works fine.
Thanks a lot.
ThomasMarch 15, 2015 at 10:15 am #87084TomLead DeveloperLead DeveloperFevzi – 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! π
-
AuthorPosts
- You must be logged in to reply to this topic.