WordPress.org

Ready to get started?Download WordPress

Forums

Simple Nivo Slider
More than one category? (10 posts)

  1. ddpweb
    Member
    Posted 2 years ago #

    Hello! I love this plugin! It's really well done.

    I was just curious if there is a way of having more than one post category to display sliders from?

  2. Thomas M Steenholdt
    Member
    Plugin Author

    Posted 2 years ago #

    I just pushed version 0.5.1 to the wordpress repository. That version of the plugin will allow you to specify a category using a "shortcode" to display the slider.

    If you upgrade to 0.5.1 and put something like this in your content:

    [snivo id="div_id_1" category="promotions"]
    [snivo id="div_id_2" category="promotions2"]

    will allow you to have multiple sliders with different categories.

    If you were thinking about multiple categories for a single slider, I never really thought about it? Would this be useful?

  3. ddpweb
    Member
    Posted 2 years ago #

    Awesome. thank you! Yes, I can see the need for being able to have more than one category display in the slider. For instance, my client has a company news category, and a project news category, and it would be nice to be able to display slides from both of these.

    What would the syntax be to use your example in the template tag:

    <?php if (function_exists('simple_nivo_slider')) simple_nivo_slider(); ?>

    thank you!

  4. Thomas M Steenholdt
    Member
    Plugin Author

    Posted 2 years ago #

    Something like this would work today:

    <?php
       if (function_exists('simple_nivo_slider')) {
          simple_nivo_slider("slider", 3);
          simple_nivo_slider("slider2", 4);
       }
    ?>

    However, the numeric-only categories might not the most usable in the world, so I'll fix those to accept textual (and multiple) categories in a (not too distant) future release...

    /Thomas

  5. ddpweb
    Member
    Posted 2 years ago #

    That is very helpful! Thank you Thomas! I will check it out.

    So in this method, I'm defining each slide, and the category it's coming from?
    So in this, it would be the first slide and from category with the id=3?

    simple_nivo_slider("slider", 3);

    This would be the second slide from the category id=4

    simple_nivo_slider("slider2", 4);

    is that correct?

  6. Thomas M Steenholdt
    Member
    Plugin Author

    Posted 2 years ago #

    Correct. :-)

    The first parameter is basically the ID of the DIV, in which the images are placed in the generated code. For multiple sliders, you'll need different IDs.

    The second parameter is the posts category.

    I've just committed version 0.5.2 which allows textual categories (slug) and multiple categories as well...

    With 0.5.2, this should work:

    <?php
       if (function_exists('simple_nivo_slider')) {
          simple_nivo_slider("slider1", "promo");
          simple_nivo_slider("slider2", "promo,news");
       }
    ?>

    I've tries to explain this stuff in the readme too, so check it out - And please let me know what you think.

    /Thomas

  7. onebuyone
    Member
    Posted 2 years ago #

    need help please.

    i still little bit confuse about simple_nivo_link, and there's no complete references on google about this

    how can i modify simple_nivo_link of <?php if (function_exists('simple_nivo_slider')) simple_nivo_slider(); ?> that placed on my html body?

    thanks

  8. Thomas M Steenholdt
    Member
    Plugin Author

    Posted 2 years ago #

    Hi there... The simple_nivo_link should be added to the posts you need to specify a link for, as a custom field.

    Or you can install a plugin like Page Links To and have that handle the link stuff for you (also done for each post, but more intuitive) :-)

    /Thomas

  9. onebuyone
    Member
    Posted 2 years ago #

    hi thomas,

    so the code in the post page should be like this?
    simple_nivo_link(http://wordpress.org/example/)

  10. Thomas M Steenholdt
    Member
    Plugin Author

    Posted 2 years ago #

    No, you need to do this in a post, where you can add a custom field. It's not a code thing... Perhaps the FAQ explains it?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic