trint
Forum Replies Created
-
Please, I need this fonctionnality.
Bests
I found this article but I don’t know how to adapt it to my situation.
Forum: Fixing WordPress
In reply to: List custom taxonomies termsIs it possible ?
I searched all day and I not found a solution… ??
Any help is greatly appreciated.
Thanks!wahou !! you’re the best !
It works like a charm !
Thank you for taking time for myself and this project.
Many many thanks you saved my life ;-).
PierreHere is my script:
jQuery(function ($) { var $container = $('#isotope-list'); //The ID for the list with all the blog posts $container.isotope({ //Isotope options, 'item' matches the class in the PHP itemSelector : '.item', layoutMode : 'masonry' }); //Add the class selected to the item that is clicked, and remove from the others var $optionSets = $('#filters'), $optionLinks = $optionSets.find('a'); $optionLinks.click(function(){ var $this = $(this); // don't proceed if already selected if ( $this.hasClass('selected') ) { return false; } var $optionSet = $this.parents('#filters'); $optionSets.find('.selected').removeClass('selected'); $this.addClass('selected'); //When an item is clicked, sort the items. var selector = $(this).attr('data-filter'); $container.isotope({ filter: selector }); return false; }); });
Forum: Fixing WordPress
In reply to: List custom taxonomies termsFor example:
list all taxonomy B terms that are relative to taxonomy A term 1.Forum: Fixing WordPress
In reply to: List custom taxonomies termsAny idea on how to do that ?
Hello again Swayam,
we are very close to solution ??
I updated filters request and it change filters on artist selection.
Here is the new request.<?php $portfolio_artiste_slug = get_query_var('term'); $portfolio_artiste_post_IDs = get_posts(array( 'post_type' => 'portfolio', 'posts_per_page' => -1, 'tax_query' => array( array( 'taxonomy' => 'portfolio_artiste', 'field' => 'slug', 'terms' => $portfolio_artiste_slug ) ), 'fields' => 'ids' )); ?> <ul id="filters"> <li><a href="#" data-filter="*" class="selected">Tous les projets</a></li> <?php $terms = wp_get_object_terms($portfolio_artiste_post_IDs, 'portfolio_tag' , array( 'orderby' => 'name', 'order' => 'ASC' )); $count = count($terms); if ( $count > 0 ){ foreach ( $terms as $term ) { echo "<li><a href='#' data-filter='.".$term->slug."'>" . $term->name . "</a></li>\n"; } } ?> </ul>
Despite of that, filters does’nt work on projects display…
Hello Swayam,
I replace name by slug but nothing change, on artiste 02 it displays all tags.On artist02 page it would be only tag04 tag05 tag06 filters and not all tags.
Thanks for your code.
I put your code inside function.php. Seems to not work.
You’re right :
register_post_type( ‘portfolio’, $args );
register_taxonomy( ‘portfolio_tag’, array( ‘portfolio’ ), $taxonomy_portfolio_tag_args );Hello,
don’t worry for late reply, it’s already nice to answer ??
Yes the problem is that filtering doesn’t works.Nobody ?
Getting WordPress Term Results that are Relative to a Different Taxonomy
Do you think this could be a solution so as to get the filter list which corresponds to artist ?Forum: Fixing WordPress
In reply to: List custom taxonomies termshere is the back office custom post type fields: screenshot