Support Forums for LiveMesh Themes & Plugins › Forums › Wired Theme Support › [Filterable Gallery] Change gallery categories order
Tagged: filterable gallery, gallery, showcase-filter, wired
- This topic has 4 replies, 2 voices, and was last updated 7 years, 7 months ago by
M_DNL.
-
AuthorPosts
-
February 23, 2016 at 11:24 pm #19529
M_DNL
MemberHello,
> I’m trying to change the list order of gallery categories on the filterable gallery.
> And I would like to hide the “All” filter in the list.
I’m actually seeking in gallery-functions.php
>> First clue :
gallery-functions.php lines 24-30
$query_args = array( 'post_type' => 'gallery_item', 'posts_per_page' => $args['posts_per_page'], 'paged' => $paged, 'orderby' => 'menu_order', 'order' => 'ASC' );
How can I configure the ‘orderby’ ?
>> Second Clue :
gallery-functions.php lines 249-280
if (!function_exists('wired_get_gallery_categories_filter')) { /** Isotope filtering support for Gallery pages * */ function wired_get_gallery_categories_filter() { $output = ''; $gallery_categories = get_terms('gallery_category'); if (!empty($gallery_categories)) { $output .= '<ul id="showcase-filter">'; //$output .= '<li class="filter-text">' . esc_html__('Gallery Filter:', 'wired') . ''; $output .= '<li class="segment-0">' . esc_html__('All', 'wired') . ''; $segment_count = 1; foreach ($gallery_categories as $term) { $output .= '<li class="segment-' . $segment_count . '">term_id . '" title="' . esc_attr('View all items filed under ', 'wired') . $term->name . '">' . $term->name . ''; $segment_count++; } $output .= ''; } return $output; } }
Is the order could be modified here ? Is the “All” filter item could be hidden here ?
Thank you guys
February 23, 2016 at 11:51 pm #19530M_DNL
MemberResolved 50% :
>> To hide the “All” filter in the list, simply.. hide it..
.portfolio-archive { display:none !important; }
February 24, 2016 at 2:54 am #19532M_DNL
MemberResolved 100% :
>> portfolio-fonctions.php line 348
Change :
$portfolio_categories = get_terms($taxonomy);To :
$portfolio_categories = get_terms($taxonomy, array(
‘orderby’ => ‘slug’,
‘order’ => ‘ASC’
));February 24, 2016 at 10:58 am #19558Veena
ModeratorGlad that you found the solution and thanks for sharing the solution with us .
February 24, 2016 at 11:04 am #19559M_DNL
MemberIn my response, “slug” is the ID of the gallery category. And it will order it alphabetical.
I just add numbers before Galleries categories ID (ex: 1-webdesign ; 2-print ; 3-branding ; …)
It works but I’m staying open to better solutions 🙂
-
AuthorPosts
- The forum ‘Wired Theme Support’ is closed to new topics and replies.