Tag Info

Hot answers tagged

3

Here is an idea, sort your your loop before it executes. Your current issue is just this. You will see that the type of sorting (if I'm correct where I believe your order is not alphabetical according to post type) is not possible natively, so we need a work-around (even if you just need post types sorted alphabetically, the native way still lack proper ...


2

You are getting your post results in the order that the Relevanssi plugin thinks is correct. That is, you are getting the results in the most relevant order according to the plugin's logic (I don't know what that is exactly) which is the point of the plugin. Generally speaking, ordering by post type isn't that hard: function orderby_type($orderby) { ...


2

This is just a normal plugin. You can install it by doing the following: On the Github Page click "Download Zip" button on the right side. On your WordPress admin panel navigation to Plugins Click "Add New" button at the top of the page which will take you to the "Add Plugins" page. Click "Upload Plugin" button at the top which will allow you to upload and ...


1

I can confirm that url-decoding the search query is the correct approach. In fact, it is done in WordPress core for the search parameter of WP_Query but not when the search string is from a $_GET request as it is seen in WP_Query::parse_search() method, wp-includes/query.php#L2061 (WP 4.2.2): if ( empty( $_GET['s'] ) && $this->is_main_query() ) ...


1

Did you search the endless expanses of the internet ? Because the first entry on the SERP is an article at the relvanssi knowledge base, with the title ┬╗Separating posts by post type┬ź, sounds fitting to me. Below is the code for the proposed approach: add_filter('relevanssi_hits_filter', 'separate_result_types'); function separate_result_types($hits) { ...



Only top voted, non community-wiki answers of a minimum length are eligible