WordPress.org

Ready to get started?Download WordPress

Forums

SEARCH RESULT IF 1 -> REDIRECT TO THAT RESULT? (1 post)

  1. xionkid
    Member
    Posted 1 year ago #

    Hi!

    The subject says it all, say you run a search for "tree" and there is only one matching result instead of showing you the title of the result and an excerpt, how about just direct you right to the full content for that entry?

    Anyone executed this functionality, know of a solution or have thoughts on one? I wanted to poll the community first before attempting to write one.

    If I have to write one I am thinking of using the search counter, and doing something like ... in search.php in the header put a redirect condition before any other PHP that says, If search results = 1 .... Redirect to the_permalink

    Just a thought .. not sure it would work.

Topic Closed

This topic has been closed to new replies.

About this Topic