Home Forums Plugin Support Advanced Search Widget Display Search Query and back to results link

This topic is: not resolved

Tagged: 

This topic contains 9 replies, has 2 voices, and was last updated by  manlioma 6 years, 8 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #634

    manlioma
    Participant

    Hi, how to display the multiple search queries in a results page ?? the code the_search_query(); doesn't works !!

    And How I can back to results page from single.php after search ?
    thanks by

    #635

    Tareq Hasan
    Keymaster
    Post count: 2831

    Can you clarify about multiple search queries? According to WordPress, there is only one main search query and you can display that by the_search_query(). If you are referring to display other custom fields and taxonomy inputs, there is no provided way to display the queries, but you can show them by raw php. Something like < ?php echo esc_attr( $_GET['variable_name_here'] ); ?>

    And I am not clear about your second question too.

    #636

    manlioma
    Participant

    Hi, so I want to say..
    In my form you can search posts in category and price range
    In the results page I would to have:
    … your Search Result for: ” Category 1″ from “price min” to “price max”

    #637

    Tareq Hasan
    Keymaster
    Post count: 2831

    You can try something like that in your result page:

    < ?php
    $cat = get_term_by('id', $_GET['category'], 'category');
    echo "your Search Result for: '{$cat->name}' from '{$_GET['min_price']}' to '{$_GET['max_price']}'";
    ?>
    
    #638

    manlioma
    Participant

    works !! thank you very much !!!

    #664

    manlioma
    Participant

    Hi Tareq, and what about taxonomy ??

    I tryed

    $cat = get_term_by(‘id', $_GET[‘taxonomy_name'], ‘taxonomy');

    but doesn't work.. any suggestion??

    thank you !

    #665

    Tareq Hasan
    Keymaster
    Post count: 2831

    try like this:
    $tax = get_term_by(‘id’, $_GET[‘tx_TAXONOMY_NAME], ‘taxonomy’);

    #666

    manlioma
    Participant

    I tryed this, but doesn't work.. ‘COMUNE' is my taxonomy

    $tax = get_term_by(‘id', $_GET[‘tx_comune'], ‘taxonomy');
    echo “{$tax->name}

    #667

    Tareq Hasan
    Keymaster
    Post count: 2831

    $tax = get_term_by(‘id’, $_GET[‘tx_comune'], ‘comune’);
    echo “{$tax->name}

    #668

    manlioma
    Participant

    nothing new 🙁

Viewing 10 posts - 1 through 10 (of 10 total)

The topic ‘Display Search Query and back to results link’ is closed to new replies.