Archived topic
Error and no Nav menu showing on site
5 replies · Started by Pablo on May 16, 2019
Hi, there.
For some reason, my site is showing an error at the top of every page:
add_filter( 'generate_show_excerpt','generate_show_excerpt_categories' ); function generate_show_excerpt_categories( $show_excerpt ) { if ( is_category() ) { return true; } return $show_excerpt; }
Skip to content
I'm using the Freelancer GP theme.
What I've already tried:
1. Disabled all plugins, same error shows.
2. With plugins enabled and disabled, tried different themes. Same error.
Any suggestions?
Hi there,
looks like you have the code add to a GP Hook. Which version of GeneratePress Premium are you using?
Ah, that code is the cause:
add_filter( 'generate_show_excerpt','generate_show_excerpt_categories' );
function generate_show_excerpt_categories( $show_excerpt )
{
if ( is_category() ) {
return true;
}
return $show_excerpt;
}
All fine when disabled. Do you know why this would be causing an issue? Really could use the function that the code provides (relating to Edward Olive).
Paul
You would need to add that Filter Function to your Child Theme Functions file or use the Code Snippets plugins. Filters like that cannot be added to Hooks.
I added the code via the HFCM plugin, as stated in the GP documentation.
This is happening on my site: Your Kitchen Zone, ESO FAQs, We Trust, Cycling Off-Grid and The Golf Wish (I'm only mentioning the sites here as a reminder to my future self!).
And is it working correctly now?