Archived topic
Adding Meta Title and Descriptions
3 replies · Started by Lindsay on July 16, 2022
I followed the instructions below and added the php code to the Snippets plugin.
https://generatepress.com/forums/topic/editing-meta-title-and-meta-description-in-each-page/
But I received an error on Save Changes.
The code snippet you are trying to save produced a fatal error on line 1:
syntax error, unexpected ')', expecting '{'
Perhaps it should be added to Elements... not sure. Grateful for any pointers.
Hi there,
there was a mistake in Toms code, which i have just corrected.
If you can try that now ?
Fab, perfect.
In case this helps anyone else I changed the second line to:
if ( is_singular( 'page' ) || is_singular( 'post' ) ) {
so that it only applies to pages and posts and not the rest of my CPTs.
Glad to hear thats working for you - and thanks for sharing your option