auto meta description page, single, product
-
Hi there,
I’m testing your theme and is fast and light, I’m satisfied.
I have only a problem.
Usually I use a function to get a meta description automatically generated (get the_content) if its custom field is empty, but it doesn’t work with generatepress.
So I have found the function below in your forum and I tried many times to modify it for my need, but dont know how to.
In case I can write my ‘usual’ function.
I will greatly appreciate your suggestion.function my_description() { if ( is_single() || is_page() || is_category() || is_product() ) { $meta_desc = get_post_meta( get_the_ID(), 'description', true ); if ( $meta_desc ) { printf( '<meta name="description" content="%s">', $meta_desc ); } } } add_action('wp_head', 'my_description', 1);
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘auto meta description page, single, product’ is closed to new replies.
