This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • wikotwikot
    Participant

    Hello, thanks so much for the answers, you’ve been of great help.
    Sorry to bother you again, but I was wondering if there’s a way to order the search results using this custom query:
    [php] $query->set( ‘orderby’, array(
    ‘meta_value_num’=>’ASC’,
    ‘title’=>’ASC’
    ) );
    $query->set(‘meta_key’, ‘contenido’);
    }
    #’contenido’ is a boolean custom field[/php]
    I’ve tried to use it with the pre_get_posts hook combined the is_search() conditional but it doesn’t seem to work:
    Thanks again for the help.
    Edit: I added an image of the query because the code isn’t being displayed correctly.

    • This reply was modified 7 years, 7 months ago by wikotwikot.
    • This reply was modified 7 years, 7 months ago by wikotwikot.
    • This reply was modified 7 years, 7 months ago by wikotwikot.
    wikotwikot
    Participant

    Hello, thanks so much for your answer, it works well
    Sorry for being a pain. but I have another question, is there a way to sort the results alphabetically?
    Thanks again for the help.

    wikotwikot
    Participant

    Thank you so much for the help, I ended up using jQuery to solve this since it was easier, but couldn’t have done it without your help.
    Now, I was wondering if there’s a way to move the magnifying glass to the end of the search boxes, like the attached image.
    Thanks again for the help

    in reply to: Is there a way to use search parameters as conditional values? #19364
    wikotwikot
    Participant

    Hello, thanks for your answer.
    I think I’m very close but when I try your code and try a var_dump it returns empty, is there a step I’m missing?
    I don’t understand where is the search_id declared, is it inside the function? or is it given as a parameter? I’m a begginer with PHP, sorry.
    Other thing I saw when trying your code is that the HTML code I try to echo with the hooks, gets to the bottom of the page, after the visible area.
    What I want is to be able to do is to use an if statement like this:
    [code]if(‘field_name’==’value’){
    //HTML goes here}[/code]
    Thanks again for the help.

    wikotwikot
    Participant

    Hello,
    Thanks for the fix, it does hide the second bar.
    Here is the shortcode I’m using in the website:
    [code] [wd_asp elements='search,settings' ratio='20%,80%' id=2] [/code]
    Thank you again for the help!

    wikotwikot
    Participant

    You cannot access this content.

    wikotwikot
    Participant

    Thank you very much, that worked.
    Now I have a bug when there’s not a match in the search, the search field gets duplicated and I’m not sure why. I attached a screenshot of the issue, I hope you can help me with this.
    Thanks again for the help.

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