- This topic has 8 replies, 4 voices, and was last updated 3 years, 4 months ago by David.
-
AuthorPosts
-
November 26, 2020 at 1:42 pm #1550644Frank
<!--more-->
works fine, but<!--more Weiterlesen-->
doesn’t, it’s just ignored!
The page I need help with: https://www.horst-groschopp.de/category/video/
Look at the last two post. The second to the last has the tag<!--more Weiterlesen-->
, the last is a copy of that post with the tag<!--more-->
.
How to fix that?November 26, 2020 at 2:05 pm #1550668TomLead DeveloperLead DeveloperHi there,
Right now we have an option to add your own global more text that overwrites this feature in WP.
You can tell GP to get out of the way and use the custom text like this:
add_action( 'wp', function() { remove_filter( 'the_content_more_link', 'generate_blog_content_more', 15 ); remove_filter( 'the_content_more_link', 'generate_content_more' ); } ); add_filter( 'generate_more_tag', function( $more ) { global $post; if ( strpos( $post->post_content, '<!--more' ) ) { $more = true; } return $more; } );
Will see if we can implement this into the theme itself 🙂
November 26, 2020 at 3:13 pm #1550766FrankThanks Tom.
Where exactly do I put this?November 26, 2020 at 6:31 pm #1550947ElvinStaffCustomer SupportHi Frank,
What Tom provided is a PHP snippet.
Here’s how to add PHP snippets – https://docs.generatepress.com/article/adding-php/
November 27, 2020 at 1:00 am #1551347FrankI didn’t ask how, but where. I suppose it is the functions.php
November 27, 2020 at 1:31 am #1551406FrankI added it in the functions.php starting at line 74 and it works. Thanks a bunch.
November 27, 2020 at 3:53 am #1551679DavidStaffCustomer SupportHi there,
that document explains how and where should add the snippets:
1. Is in Child Themes functions.php
More info here on adding a Child Theme:
https://docs.generatepress.com/article/using-child-theme/2. Install the Code Snippets plugin and add a new snippet.
What you must NOT do is make edits to the Parent Themes function files.
When a Theme is updated, it replaces all the theme files, which means your changes will be lost.November 27, 2020 at 4:05 am #1551708FrankWell thanks.
I updated the function.php of the theme, because I understood, that Tom will correct this bug in the next version, so that nothing will get lost. 😉November 27, 2020 at 4:33 am #1551771DavidStaffCustomer SupportI would still suggest you keep the changes within a child theme or code snippets.
Tom doesn’t state it’s a definite change that will happen in the next update.Making updates to the theme requires a lot of considerations, such as will the change affect the 100’s thousands of other sites running on GP? Or will we need to ‘prepare’ the theme for a specific update – it may be we need to change other code before a change like this can be implemented.
-
AuthorPosts
- You must be logged in to reply to this topic.