Support Forums

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Custom Taxonomies Not Displaying in Results

Viewing 10 posts - 1 through 10 (of 12 total)
  • pneuma33
    #55304

    TL;DR (but please read): custom taxonomy values are not being pulled from the post, except for sometimes.

    I have a Custom Post Type: vehicles. I created two custom taxonomies just for that CPT: vehicle_make and vehicle_model. These were done use the CPT UI plugin. There are various other ACF fields as well.

    The search form is setup like so:
    Make | Model | Year | Location | Reset

    You can see the dev version here:
    http://tap.voltaic.xyz/inventory/

    I’m displaying the results using a custom template (600.php):

    <?php if ( $query->have_posts() )
    {
    	?>
    	
    	<div class="inv_container">
    		<p class="inv_count">Found <?php echo $query->found_posts; ?> Vehicles</p>
    		<p class="inv_note">You can bookmark and share these results.</p>
    
    		<div class="inv_header clear">
    			<div class="inv_make">Make</div>
    			<div class="inv_model">Model</div>
    			<div class="inv_year">Year</div>
    			<div class="inv_location">Location</div>
    			<div class="inv_row">Row</div>
    		</div>
    		<?php while ($query->have_posts()) { $query->the_post(); ?>
    			<?php 
    			$classes = array();
    			$classes[] = "inv_item";
    			$classes[] = "clear";
    			?>
    
    			<article <?php post_class($classes); ?> >
    				<div class="inv_make"><?php echo get_field('v_make')->name; ?></div>
    				<div class="inv_model"><?php echo get_field('v_model')->name; ?></div>
    				<div class="inv_year"><?php the_field('year'); ?></div>
    				<div class="inv_location"><?php the_field('city'); ?></div>
    				<div class="inv_row"><?php the_field('row'); ?></div>
    			</article>
    
    		<?php }	?>
    	</div>
    
    	<?php
    }
    else
    {
    	echo "No Results Found";
    }
    ?>

    When you visit the dev site you’ll see that I’m receiving a PHP error because the custom taxonomy values are not being pulled from the post. However, if you look at this custom search you’ll notice that one of the results is showing as intended:
    http://tap.voltaic.xyz/inventory/?_sft_vehicle_make=honda&_sft_vehicle_model=civic&_sfm_year=1999

    I added about 1800 posts to this CPT using WP Ultimate CSV Importer. When I edit one of these posts, from the import, the custom taxonomies show up on the edit screen, selected as they are expected to be (I also imported a sampling of posts using another CSV importer and it had the same results). Now, here’s the interesting part, if I update one of the posts, from the import, it will show up as expected in the results (I just edit the post and immediately click Update, nothing else). The Honda Civic from that custom search is one such post that was updated after the fact. You can imagine that I’m not keen on updating 1800 posts one at a time. Not to mention, I shouldn’t have to.

    I installed a different search/filter plugin (Filter Custom Fields & Taxonomies Light) and it displayed results correctly. Though, I don’t like that plugin for its UX and various other reasons. It doesn’t have any problem pulling the custom taxonomy value from the post. You can see those results pulling from the same CPT here:
    http://tap.voltaic.xyz/test-search/

    I really need a resolution for this issue. I’ve spent at least 8 hours trying various things to resolve it. Please help.

    Trevor Moderator
    #55317

    Hi Keith

    That’s an epic. When you import data using utilities like this, they don’t inform any other WordPress plugin that they have done this. In the case of S&F, that means you have to re-build the cache. If it is not that, then maybe we can talk (voice or video, as opposed to typing on IM) on Skype?

    pneuma33
    #55379

    Thanks Trevor,

    I had rebuilt the cash twice in my troubleshooting. I’ll rebuild again and see what that does. If it still fails, I’d appreciate a call.

    pneuma33
    #55381

    Rebuilding cache didn’t solve the problem.

    pneuma33
    #55383
    This reply has been marked as private.
    Trevor Moderator
    #55385

    Is that 5 hours from now, or 4 hours?

    pneuma33
    #55387
    This reply has been marked as private.
    Trevor Moderator
    #55488

    Sorry, I was gone from the office by then 🙁

    I think you are 4 hours behind us, so your time now should be 7:36AM, so I missed you 🙁

    Trevor Moderator
    #55490

    Anyway, I sent a contact request to you.

    Trevor Moderator
    #55524

    Hey Keith. I had a thought. Instead of having a Post meta field for make, why not use the custom taxonomy?

Viewing 10 posts - 1 through 10 (of 12 total)

The topic ‘Custom Taxonomies Not Displaying in Results’ is closed to new replies.