How to get search results to use description tag instead of the_excerpt
-
I’m fine with the normal WordPress search functionality, except that it looks for the_excerpt which can be problematic on pages, where no excerpt field exists. That’s because the content often has submenus in the first 155 characters, making the output look silly. Could someone help me with the following options:
1. Code to pull the page’s “description” tag instead of the excerpt. Every page I create has a description meta tag for SEO, so this would be fine. Ideally, having my code look for the_excerpt if it’s there, or the description tag if no excerpt exists.
2. Alternatively, some way to allow the admin area to include a field for creating an excerpt on pages. I have no idea if that’s even possible, never mind knowing how to do it if it is.
- The topic ‘How to get search results to use description tag instead of the_excerpt’ is closed to new replies.