Category query giving an error
-
I’m trying to use the category shortcode provided in the gist to load more posts from the current category (I’ll late need to make this into a more complicated query, but for now this is fine):
<?php $cat = get_category( get_query_var( 'cat' ) ); $category = $cat->slug; echo do_shortcode('[ajax_load_more category="'.$category.'"]'); ?>
When I add that, I get the following error:
Catchable fatal error: Object of class WP_Term could not be converted to string in /nas/content/staging/hurstpub/wp-includes/query.php on line 1596
The category queries a custom post type which might be relevant. I cannot figure out a solution to this – if anyone knows of one, or has any ideas, I’d be very grateful!
Thanks
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘Category query giving an error’ is closed to new replies.