Archived topic
Hide Archive page excerpts
26 replies · Started by Earl on May 23, 2022
You're welcome
Hey Dave,
Added the code, cleared the cache and the excerpt still haunts me.
I just tested the code, it works fine on my site.
Can you make sure the you are using ' not’ in your code?
And besides the more tag, are you using custom excerpt?
https://wordpress.com/support/excerpts/#create-an-excerpt
Let me know!
this is the code from my function php file:
<?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’ );
Just to be clear, I am trying to remove the excerpt from the blog post from being displayed on archive pages. I did just check the page in another browser from the one I'm working in and the excerpt still displays.
I did just check the page in another browser from the one I’m working in and the excerpt still displays.
I know, I can see that too. But you didn't answer my question. Are you using custom excerpt?
The code you pated is not wrapped with the code tag, so I can't check if the format is correct, so can you wrap the code with the code tag?
https://www.screencast.com/t/FMicVg3blF
sorry missed part of your question.
I haven't added anything custom to the theme.
I did go to the theme customizer -> Layout -> blog -> and set the excerpt work count to '0'
My question was are you using the custom expert, can you check if this field is blank in your post editor? Thanks!
Please refer to the first image in the blow article:
https://docs.generatepress.com/article/excerpt-issues/
Sorry for being a knucklehead, now I know what you mean:)
No, nothing is entered at the blog post level for custom excerpts. I do use rank math and I've put in a custom description, but it's pulling from the blog post not the rank math description.
Hi Earl,
Also tested the code and it works as expected from my end, can you try checking for any syntax errors in your functions.php file?
The code should be exactly:
add_filter( 'generate_more_tag', '__return_empty_string' );
If that doesn’t work, as a 2nd course for debugging, try removing the code from your functions.php file, and then install a plugin called Code Snippets, and then add the PHP code there.
Lastly, can you also try disabling other plugins temporarily as another course of debugging? Try #1 here: https://docs.generatepress.com/article/debugging-tips/
Kindly let us know how it goes. Hope to hear from you soon!
Got everything to work this morning!
Big thank you to Dave, Ying and you Fernando for dealing with my shenannigans :)
Final question:
I want to do a blogroll on the front page with elements, can you provide a link to do that?
Thanks again!
Glad to hear that - Would you mind raising a new topic? So we can mark this as resolved :)
Will do, thanks David