Archived topic
Hide Archive page excerpts
26 replies · Started by Earl on May 23, 2022
I've read the documentation here -> https://docs.generatepress.com/article/blog-content-layout/
that tells me to set the excerpt to 0 if I don't want it show.
I've done that, but can't get the excerpt on the archive page to disappear.
Thanks!
Hi there,
Any chance you can link us to the page in question?
You can use the private information field:
https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information
Let me know :)
Hi Leo,
I've included a URL to one of my archive pages in the private window. The site shown is a staging site that was set up that I'll move to the primary URL once the project is finished.
Hi there,
the Excerpt word count in the blog settings only applies to the auto excerpt.
And your posts are using the More tag.
You can tell GP to ignore the more tag and use the auto excerpt by adding the PHP Snippet provided here to your site:
https://docs.generatepress.com/article/using-the-more-tag/#overwriting-the-more-tag
Hi Dave,
I read the doc in the link, but I don't know where to insert the php code that it references.
Can you help me with that? Thanks!
Sorry my bad - this doc explains how to add PHP:
https://docs.generatepress.com/article/adding-php/
TLDR: If you're using a Child Theme, add the code to your Child Theme functions.php. If you are not using a Child Theme, install the Code Snippets plugin ( link in the doc ) and add the code to a New Snippet.
thanks for the quick response...
I am using the child theme, but I can't seem to find where to edit the function php file...
I thought it was in Appearance -> Theme Editor BUT....
Theme editor is not listed under 'Appearance'
sorry to be 'that guy' today...
Are you logged in as an Admin user ?
Yes sir.
for this project, I created a staging site from the original to work on and then installed GP.
Just tried to create a new admin account to see if the edit function PHP would show up under appearance... no luck
Try clearing browser caches and cookies OR login using an incognito/private browser.
That will eliminate caching or cookies as an issue.
If that don't work then it could be security mod in your WP install. Any security plugins installed ?
still no joy.
no security mods other than wp rocket and secure copy protection.
Hi Dave,
Looks like I have to take the long way around and edit the functions php file with the host. Does the code below look correct?
<?php
/**
* GeneratePress child theme functions and definitions.
*
* Add your custom PHP in this file.
* Only edit this file if you have direct access to it on your server (to fix errors if they happen).
*/
add_filter( 'generate_more_tag', '__return_empty_string' );
Personally edit the files at the server level is best :)
That code looks correct!
Thanks for your help Dave!