WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to access Query string? (4 posts)

  1. Johnster
    Member
    Posted 3 years ago #

    Hey guys,

    I got a page like this examplesite.org/?s=as&cat=0&p=SE19&sa=Search . How do i access the variable in the search results page? Native PHP code doesn't work. Sorry i'm new to wordpress and apologies if this pretty basic stuff. I need to retrieve value of cat, p and s. Appreciate your help.

    Thanks, S

  2. chinmoy
    Member
    Posted 3 years ago #

    Use get_query_var() function like get_query_var('cat'), get_query_var('s')

  3. Johnster
    Member
    Posted 3 years ago #

    thanks sorted!

  4. chinmoy
    Member
    Posted 3 years ago #

    mark it as "RESOLVED"

Topic Closed

This topic has been closed to new replies.

About this Topic