Looking for support? You can access the support system via your account.
Lars Faye
Forum Replies Created
-
Lars Faye in reply to:
Live Filtering WITHOUT using the Form? Or: Live Filter using Links?(Private) July 9, 2020 at 4:07 pm #252262Yes, I will circle back here and post my solution once this is done, in case it will be help for future users.
Lars Faye in reply to:
Live Filtering WITHOUT using the Form? Or: Live Filter using Links?(Private) July 9, 2020 at 4:04 pm #252258We’ll need the form, along with the main image “filters”, but I appreciate your approach/brainstorming.
If I understand you correctly, to go the more custom javascript route, I just need to write a function that will emulate the change/select function of the taxonomy dropdown (it will be a dropdown in this case anyway)? That’s kind of what I figured, and I’ve just recently done something just like it for Mapify Pro, so I’ll just go that direction. I just wanted to make sure there wasn’t something I was missing that was built into S&F already.
Thanks, as always, Trevor!
Lars Faye in reply to:
Group Results by Taxonomy(Private) April 29, 2019 at 7:16 pm #209600Hi Trevor,
Thanks so much! I understand this is outside your support and your suggestion on how I would theoretically was EXACTLY what I needed to make this happen. I was able to get this to happen following your suggestion.
I saw some others that were trying to do this, so I wanted to post my code in case in might help someone else. This code is using the Custom query output, so this code is placed within my custom template. It’s commented and should hopefully make sense to someone who’s trying to achieve something similar. It should be noted that for this client, it made the most sense for the posts be sorted ASCENDING by DATE, rather than the default DESCENDING. I imagine if you wanted/needed to use DESCENDING, then you would need to base the foreach and conditionals off of next_post instead of prev_post:
<div id="faqloop"> <?php $args = array( 'search_filter_id' => 8836 ); $faqs = new WP_Query($args); if ($faqs->have_posts() ) : $count=0; while ($faqs->have_posts() ) : $count++; $faqs->the_post(); //Custom Fields $question = get_field( 'faq_question' ); $answer = get_field( 'faq_answer' ); // Adjacent Posts, IDs and Terms $prev_post = get_previous_post(); $next_post = get_next_post(); $next_post_id = $next_post->ID; $prev_post_id = $prev_post->ID; $prev_terms = get_the_terms( $prev_post_id, 'faq_category' ); $terms = get_the_terms( $post->ID, 'faq_category' ); // Create variable containers for the post IDs $term_slug = array(); $prev_term_slug = array(); $term_name = array(); // Current tax loop foreach($terms as $term) { $term_slug = $term->slug; $term_name = $term->name; } //Adjacent Post tax loop foreach($prev_terms as $prev_term) { $prev_term_slug = $prev_term->slug; } ?> <?php //Echo term title if it's different than previous term OR is the last post in the loop if($prev_term_slug !== $term_slug || !$prev_post){ ?> <div class="faq-section--header <?php echo $term->slug; ?>"> <h3><?php echo $term_name; ?></h3> </div> <?php } ?> <div class="faq-section--questions"> <div class="faq-entry"> <div class="faq-entry--question"> <i class="faq-toggle"></i><span><?php echo $question; ?></span> </div> <div class="faq-entry--answer"> <?php echo $answer; ?> </div> </div> </div> <?php endwhile; ?> <?php else: ?> <span data-search-filter-action='infinite-scroll-end'>No FAQs match that search or combination</span> <?php endif;?> <?php wp_reset_postdata(); ?> </div>
Lars Faye in reply to:
Cannot Activate License(Private) April 1, 2019 at 4:46 pm #207127Gotcha. I’ll update manually for this round. Thanks!
Lars Faye in reply to:
Cannot Activate License(Private) April 1, 2019 at 4:31 pm #207120Version 2.3.4. Still getting the same thing this morning. 🙁
Lars Faye in reply to:
Custom Select Dropdowns using JS?(Private) November 2, 2018 at 4:33 pm #192615YES! I never realized that’s what a Combobox was, haha! Otherwise I would have went straight for that. Good to know. That did it and many nested classes later I have a fully styled dropdown that meets the client’s spec. Thanks Trevor, you created an amazing tool that just keeps on giving! 🙂
Lars Faye in reply to:
Filtering custom taxonomy: show combined results instead of cross-filtering?(Private) December 7, 2017 at 11:34 pm #146385My mistake: I neglected to see there was an operator toggle for the Taxonomy field itself! We’re good!
Lars Faye in reply to:
Sort Results by Meta Value and THEN by Title?(Private) December 7, 2017 at 7:34 pm #146347Well, I got good news…this is actually totally possible using your Query filter/hook! I ran a relational “OR” meta query on the field and it seems to be performing as I desire (places all posts with the meta value at the front, sorts alphabetically, then shows the rest of the posts without the meta value also in alphabetical order).
$query_args = array( 'post_type' => 'faculty', 'posts_per_page' => -1, 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'featured_faculty', 'compare' => 'EXISTS', ), array( array( 'key' => 'featured_faculty', 'compare' => 'NOT EXISTS', ), ), ), 'orderby' => array( 'meta_value' => 'DESC', 'title' => 'ASC' ), );
You can check it out here:
-
AuthorPosts