• Great work on the new release; it’s getting much better.

    Can you explain how to filter by taxonomy/tags? I’m not sure if I’m misunderstanding, if I’m doing this wrong or if this is a bug. I can’t seem to get it to filter by default tag (post_tag) or custom taxonomy.

    Using the shortcode, i’ve tried:

    //custom taxonomy page
    $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );	
    
    echo do_shortcode('[apc-carousel visible_posts=3 init_posts=6 show_title=1 show_excerpt=0 loop=1 post_type=all '.$term->taxonomy.'='.$term->name.']');

    I have a custom taxonomy called ‘authors’. The above would print something like ‘authors=jim-collins’ but nothing gets returned. Authors is the taxonomy ‘slug’ and ‘jim-collins’ is the term slug.

    I’ve also tried:

    echo do_shortcode('[apc-carousel visible_posts=3 init_posts=6 show_title=1 show_excerpt=0 loop=1 post_type=all tag=book]');

    This doesn’t filter to show only posts with ‘books’ as the tag (default post_tag). Am I missing something?

    My goal is, if on a category page to show posts in those categories, if on a taxonomy/tag page to show posts with those taxonomy/tags, etc.

    Also, is it possible to choose multiple categories? Like category=category1&category2$category3 ?

    https://www.ads-software.com/extend/plugins/ajax-post-carousel/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter cerupcat

    (@cerupcat)

    Ok, I switched to using the php method instead of do_shortcode. I’m still testing, but this seems to be working so far if anyone is interested. This shows related category posts if on a category page or single page, related tag posts if on a tag page, and all posts if on none of the above.

    if ( is_single() ) {
    			$cats =  get_the_category();
    			$cat = $cats[0]; // let's just assume the post has one category
    			$cat_name = $cat->name;
    			echo Ajax_Post_Carousel::show_carousel(0, 3, 6, 1, 0, 1, 'all', ''.$cat->name.'');
    		}
    		else if(is_category()){
    			$cat = get_category( get_query_var( 'cat' ) );
    			echo Ajax_Post_Carousel::show_carousel(0, 3, 6, 1, 0, 1, 'all', ''.$cat->name.'');
    		}
    		else if(is_tag()){
    			$tag = get_query_var( 'tag' );
    			echo Ajax_Post_Carousel::show_carousel(0, 3, 6, 1, 0, 1, 'all', 'all', 'tag='.$tag.'');
    		}
    		else if(is_tax()){
    			$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
    			echo Ajax_Post_Carousel::show_carousel(0, 3, 6, 1, 0, 1, 'all', 'all', ''.$term->taxonomy.'='.$term->name.'');
    		}
    		else{
    			echo Ajax_Post_Carousel::show_carousel(0, 3, 6, 1, 0, 1, 'post', 'all');
    		}
    Plugin Author mantish

    (@mantish)

    Hi, thanks for trying out the plugin.

    So far filtering by tags is not supported. This is likely to be included in the next version.
    Filtering by multiple categories in not supported either, but we’ll consider including this feature in future realeases.

    About your problem with the custom taxonomy, check what is being returned by get_term_by(). I think you should use $term->slug instead of $term->name

    hello
    i have a problem with excerpt
    when excerpt is enabled, posts are on each other and they dont rotate
    Am I doing somethin wrong?

    Plugin Author anabelle

    (@anabelle)

    Do you have a live link where we can check?

    Plugin Author mantish

    (@mantish)

    You must set the width of .apc_item in your CSS.
    It is also recommended that you set the height.
    Also, the area where the carousel is inserted should be wide enough so all the items can fit horizontally

    hi, great working plugin. this is my first post.

    i wanted to know that how can i change the excerpt count…?

    thanks in advance.

    Plugin Author mantish

    (@mantish)

    Hi nilesh.
    I’m not sure if I understand you…you can choose whether to display the excerpts of the posts in the carousel. There’s an option in the widget, as well as in the other methods.

    Plugin Author anabelle

    (@anabelle)

    If you mean the length of the excerpt itself, you’d have to do it using another plugin or some function in your theme.

    This is outside the scope of our plugin.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Plugin: Ajax Post Carousel] Filtering by taxonomy’ is closed to new replies.