WordPress.org

Ready to get started?Download WordPress

Forums

vSlider Multi Image Slider for WordPress
[resolved] How to make it show in category header !?!? (4 posts)

  1. candy2012
    Member
    Posted 2 years ago #

    Great plugin, unfortunately not much to find about HOW to properly use it.

    There is that option to have a slider swho in the category ... all nice, only that HOW on Earth can I make it show in that category ?!?!

    To be more clear, I want to use the slider in the header of some categories, which code should I insert in header.php in order to make the slider show there !??

    There is really NO explanation as of how to include this in template to show for those categories.

    Hope someone can help

    Thanks!

    http://wordpress.org/extend/plugins/vslider/

  2. candy2012
    Member
    Posted 2 years ago #

    hehe, I am a genius I guess :)

    EUREKA! This is IT :

    Include the category ID in the name of your category-specific slider.
    I called the sliders "cat1", "cat7", "cat45" etc. (where 1, 7, 45 are the category IDs).

    Now add this to your category header (I advise you to have a separate header for categories):

    <?php if(function_exists('vslider'))
    {
     foreach(get_the_category() as $category)
    { $thecat = "cat" . $category->cat_ID;
    }
    	vslider($thecat);
    }
    
    ?>

    That was the trick, now you can have one different slider in each category :)

    Say thanks :)

    PS: sorry for the double post earlier, was unfortunately not possible to delete :-(

  3. Mr. Vibe
    Member
    Plugin Author

    Posted 2 years ago #

    great!

    Updated vslider 4.2 checkit out folks!

    Its responsive, thumbnails enabled, html captions,

  4. vestmar
    Member
    Posted 1 year ago #

    Candy, you ARE a genious! :)

    QUESTION: what if I use vslider in posts not cats; how would that change the function in terms of syntax? (newbie here:) )

    I case you're asking why I use vslider in posts, actualy, I use wp only for websites, so no need to have multiple posts in one cat, so I forward the cat url to the first post in that cat. In that specific post I am using vslider and I want of course, a different slider in each post (1 different post per 1 different cat).

    Thanks,

    Puiu D.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic