Dynamic Description for SEO?
-
Hi! I’m interested in creating a dynamic description, and have everything I need except one part. Here’s what I want it to look like in the search engine:
Post title Post title. Category. Some other snippet of stuff that I will add.
This is what it will currently look like in the search engines with MY code:
Post title. Post title. Some other snippet of stuff I will add.
And here’s the code I use for it:
<meta name="description" content="<?php if (is_home () ) { bloginfo('name'); } elseif ( is_category() ) { single_cat_title(); if(get_bloginfo('name') != "") echo ' - ' ; bloginfo('name'); } elseif (is_single() ) { single_post_title(); } elseif (is_page() ) { bloginfo('name'); if(get_bloginfo('name') != "") echo ': '; single_post_title(); } else { wp_title('',true); } ?> Help answer this question and make the world smarter!">
I’ve gotten the post title part and the other snippet part figured out, but how can I add the category in the description tag? I’m not sure how to format it so that the category will show up in the description dynamically along with the post title and snippet that I add. This will be the default for EVERY page, and it has nothing to do with plugins.
Can anyone help me get it to look like this:
Post title. Post title. Category. Random other text here.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Dynamic Description for SEO?’ is closed to new replies.