mgsisk / webcomic

Comic publishing power for the web. Turn your WordPress-powered site into a comic publishing platform with Webcomic.
http://wordpress.org/plugins/webcomic
GNU General Public License v2.0
110 stars 29 forks source link

Webcomic plugin interferes with Woocommerce taxonomy archives #158

Closed tnog closed 11 years ago

tnog commented 11 years ago

I just discovered that the plugin interferes with Woocommerce's taxonomy archives. I'm using the newest version of Woocommerce (2.0.13) and was trying to figure out why products in taxonomy archive results were not showing up; basically returning an error that there were no products for the category.

After deactivating the webcomic plugin (4.1), products in Woocommmerce's taxonomy archives show up.

As a workaround, I created some custom taxonomy templates with hard-coded custom queries, but it looks like there may be a possible issue in your plugin code that interferes with other CPT custom taxonomy queries.

mgsisk commented 11 years ago

I'll definitely look into this, but have you tried Woocommerce with Webcomic 3.x or 4.x at all? I'm curious if they cause similar issues.

tnog commented 11 years ago

Sorry, I forgot to mention the version of Webcomic that we're using, this is the most current version, 4.1

I haven't used previous 3.x versions of Webcomic--this is the first site that I've integrated Webcomic basically--so I'm not really in a position to say.

mgsisk commented 11 years ago

Oooh, ok; my mistake. I misread that and thought you were using Webcomic 2.0.13, not Woocommerce 2.0.13.

tnog commented 11 years ago

No worries, I just reread my initial post and my writing is pretty atrocious. Thanks for checking into this.

mgsisk commented 11 years ago

The issue seems to be with the way Webcomic integrates webcomic posts into non-webcomic archive pages (like author archives, date, archives, regular tag or category archives, etc.). To address this immediately, find this line in webcomic.php (952 in my copy, but it might be slightly different in yours)

$query->set( 'post_type', array_merge( array( 'post' ), array_keys( self::$config[ 'collections' ] ) ) );

and change it to this:

$query->set( 'post_type', array_merge( get_post_types( array( 'public' => true ) ), array_keys( self::$config[ 'collections' ] ) ) );
tnog commented 11 years ago

Thanks, I'll test it now and let you know if this solves the issue.

tnog commented 11 years ago

Just tested and it looks like your code fixes the bug. Thank you for the quick response!