Tagged: x
-
AuthorPosts
-
September 24, 2016 at 9:41 pm #1189487
foox2kParticipantI need to change the blogs alphabetical order to my own order in ethos 1, the filter dont care about the order i input the category numbers just put them alphabetically
September 25, 2016 at 12:48 am #1189556
RadModeratorHi there,
Thanks for writing in.
The code responsible for that is available on this template file \wp-content\themes\x\framework\views\ethos\_index.php. You may copy that template to your child theme, eg. \wp-content\themes\x-child\framework\views\ethos\_index.php
Then edit it and find this line,
$categories = get_categories( array( 'include' => x_get_option( 'x_ethos_filterable_index_categories' ) ) );and add the ORDER you wish to apply like this,
$categories = get_categories( array( 'include' => x_get_option( 'x_ethos_filterable_index_categories' ), 'order' => 'ASC', 'orderby' => 'name' ) );The only possible orderby values are provided here https://developer.wordpress.org/reference/functions/get_terms/
‘orderby’
(string) Field(s) to order terms by. Accepts term fields (‘name’, ‘slug’, ‘term_group’, ‘term_id’, ‘id’, ‘description’), ‘count’ for term taxonomy count, ‘include’ to match the ‘order’ of the $include param, ‘meta_value’, ‘meta_value_num’, the value of $meta_key, the array keys of $meta_query, or ‘none’ to omit the ORDER BY clause. Defaults to ‘name’.
‘order’
(string) Whether to order terms in ascending or descending order. Accepts ‘ASC’ (ascending) or ‘DESC’ (descending). Default ‘ASC’.Hope this helps.
September 25, 2016 at 1:36 am #1189578
foox2kParticipanti want to change it to display the category “Estado” first and then others dont care about the order is just that i need estado to be in the front page by defaul let me add a screenshot so you can help me to change that script
September 25, 2016 at 1:49 am #1189581
RadModeratorHi there,
Unfortunately, that’s not possible. The order is only limited to what’s WordPress provide, but, you can try adding this code to Admin > Appearance > Customizer > Custom > Javascript.
jQuery( '.x-index-filters-menu li a[data-category-id="6"]' ).parent().insertBefore('.x-index-filters-menu li:first-child');Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1189487 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
