mandiwise / isotope-posts

[RETIRED] This plugin allows you to use Metafizzy's Isotope javascript plugin to display feeds of WordPress posts with a simple shortcode. Works with custom post types and custom taxonomies too.
GNU General Public License v2.0
55 stars 17 forks source link

Error in class in isoloop #9

Closed crondeau closed 10 years ago

crondeau commented 10 years ago

On line 378 of class-isotope-posts.php the class of the li can be set by using the term if the filter is set to yet and a taxonomy exists:

<?php if ( $filter_menu == 'yes' && taxonomy_exists( $filter_by ) ) { foreach( get_the_terms( $isoposts->post->ID, $filter_by ) as $term ) { echo $term->slug.' '; } } ?>iso-post">

This doesn't work right now and the following error can be seen in the HTML source code:

Warning: Invalid argument supplied for foreach() in /Applications/MAMP/htdocs/urban/wp-content/plugins/isotope-posts-master/public/class-isotope-posts.php on line 378
iso-post">

mandiwise commented 10 years ago

I was able to reproduce this error by selecting a taxonomy for the filter menu that exists but doesn't contain any terms yet—is this the case on your end too, or does the taxonomy on your site already contain terms? That would be a little more mysterious. Just want to make sure I'm on the right track before committing the bug fix.

mandiwise commented 10 years ago

Or alternatively, I can reproduce the error if terms exist in the filter menu taxonomy but none apply to any of the posts that appear in the Isotope loop...

crondeau commented 10 years ago

That must be it... I'm moving a site that was set up with a theme forest theme vas migrated everything over... I probably need to make sure that my taxonomy is set properly and all the port are in the right one..

Thanks mandi , I'll continue setting up the theme and tweaking the content.

On Wednesday, August 20, 2014, Mandi Wise notifications@github.com wrote:

Or alternatively, I can reproduce the error if terms exist in the filter menu taxonomy but none apply to any of the posts that appear in the Isotope loop...

— Reply to this email directly or view it on GitHub https://github.com/mandiwise/isotope-posts/issues/9#issuecomment-52807464 .

Christine Rondeau Bluelime Media www.bluelimemedia.com twitter: @bluelimemedia skype: bluelimemedia

mandiwise commented 10 years ago

OK, sounds good. I just committed an update that should fix the problem either way. The shortcode definitely should have been checking to see if there were actually any terms available there.

crondeau commented 10 years ago

Great, I'll check it out.

Christine Rondeau Bluelime Media www.bluelimemedia.com twitter: @bluelimemedia skype: bluelimemedia

On Wed, Aug 20, 2014 at 6:24 PM, Mandi Wise notifications@github.com wrote:

OK, sounds good. I just committed an update that should fix the problem either way. The shortcode definitely should have been checking to see if there were actually any terms available there.

— Reply to this email directly or view it on GitHub https://github.com/mandiwise/isotope-posts/issues/9#issuecomment-52859268 .