php - Set conditional on template based on a refering page -
i trying create conditional template in wordpres condition should passed if referring page search page:
i aware url_to_postid(wp_get_referer()) me page id of refering page in case not work search page not have id. there other way can this?
edit: wordpress url search http:/mywebsite.com/?s=aaa search term
depending using , how reliable needs use $_server['http_referer']
taken php manual
the address of page (if any) referred user agent current page. set user agent. not user agents set this, , provide ability modify http_referer feature. in short, cannot trusted.
you might better off either using post/get send parameter next page, or using session if need more reliability , or control.
Comments
Post a Comment