Forum Replies Created
-
AuthorPosts
-
October 18, 2018 at 1:12 am in reply to: Is there a way to use search parameters as conditional values? #19512
wikot
ParticipantHello, 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.October 9, 2018 at 7:10 pm in reply to: Is there a way to use search parameters as conditional values? #19472wikot
ParticipantHello, 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.October 3, 2018 at 11:59 pm in reply to: Is there a way to use search parameters as conditional values? #19394wikot
ParticipantThank 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 helpSeptember 28, 2018 at 10:54 pm in reply to: Is there a way to use search parameters as conditional values? #19364wikot
ParticipantHello, 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.July 30, 2018 at 7:29 pm in reply to: Is there a way to display taxonomy fields before custom fields? #18835wikot
ParticipantHello,
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!July 27, 2018 at 3:54 pm in reply to: Is there a way to display taxonomy fields before custom fields? #18801wikot
ParticipantYou cannot access this content.
July 25, 2018 at 5:01 pm in reply to: Is there a way to display taxonomy fields before custom fields? #18779wikot
ParticipantThank 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. -
AuthorPosts