I have lots of pages with similar titles which may be confusing when users search for something. To help them tell apart the pages, I'd like to add the page/post location (path) under each page/post title on the Search Results page. Is it possible?

Sample SEARCH RESULTS output:

Post Title 1

Home -> News -> Events -> Post Title 1 [content] [read more]

Page Title A

Home -> About -> Page Title A [content] [read more]

  • Yes, it's possible indeed. A simple Google, and I used WordPress SEO's Inner Links (breadcrumb code) - works well for me. – Mayeenul Islam Apr 16 '14 at 5:26
  • I know what breadcrumbs are, and that's not what I need. – Phantasmix Apr 16 '14 at 5:29
  • O, I'm sorry! I misunderstood your question. You can follow this code, though it's also a breadcrumb code, but you can have a look at the category portion. The code shows multiple categories, if the post is assigned so. You can use them to make your self path-to-post in Search result. – Mayeenul Islam Apr 16 '14 at 6:14
  • Search results return both posts and pages, not just posts. Thanks for trying, but that still wouldn't work. – Phantasmix Apr 16 '14 at 14:10
  • I don't actually know, but I think in that case, you need a conditional, like is_single() (replaced is_post()) and is_page() – Mayeenul Islam Apr 17 '14 at 3:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.