New answers tagged

0

On input, esc_url_raw() is the correct function to use which replaces sanitize_url Example : $custom_field = esc_url_raw( get_post_meta( get_the_ID(), '_custom_url', true ) );


0

There is another approach: create post meta value with the title when the article is created or updated. This way we always have the final title saved and we can sort by it right away. To do this hook to save_post, check if current post is an article and update the true_title meta value with custom field's value or with post title if that one is empty. ...


0

If you are querying all posts at once with 'posts_per_page'=> -1 it would be easiest to get all posts as an array, update title if needed, and sort them after. The disadvantage of that approach is you would have to update your loop to use properties instead of functions i.e. instead of the_title(); you would use echo $article->post_title; Example below ...


0

the data-value doesnt show, is to use. if you want to show it, it should be inside the a tag, once it is php code with variables must be inside the php "tags" so should be something like this <li data-value="<?php echo $_location1; ?>"><a href="#"><?php echo $_date1.' '.$_location1; ?></a></li>...


0

Tiago's answer will work if you wanna get coding. This plugin does exactly what you want in case you don't mind adding a new plugin to your install. https://www.relevanssi.com


0

you can create your own search creating a file called search.php in your theme, there you can customize your search however you want. probably you already have a way to call it, however you can call it with get_search_form();


Top 50 recent answers are included