Support » Plugin: Slideshow » Conditinal statement to display slidshow?

  • Resolved lilqhgal

    (@lilqhgal)


    I’m using several slideshows on one page template and displaying them with the PHP call. I am setting up a page for a client so she will be adding photos but I have created the slideshows ahead of time. What kind of conditional if statement could I wrap the PHP code in to check to see if there are any images in the given slideshow and only return my html if it has photos?

    Something like:

    <?php // if slideshow 498 has photos, return: //?>
    <h2><?php get_custom_field('slideshow_title_1', TRUE); ?></h2>
    <p><?php get_custom_field('slideshow_desc_1', TRUE); ?></p>
    <?php do_action('slideshow_deploy', '498'); ?>
     <?php // else, do nothing; //?>

    http://wordpress.org/extend/plugins/slideshow-jquery-image-gallery/

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author Stefan Boonstra

    (@stefanboonstra)

    There isn’t any nice way to do this yet, but it’s a very good idea to feature in a future release.

    For the time being, you could use this:

    <?php if(count(SlideshowPluginSlideshowSettingsHandler::getSlides(498)) > 0): ?>
        <h2><?php get_custom_field('slideshow_title_1', TRUE); ?></h2>
        <p><?php get_custom_field('slideshow_desc_1', TRUE); ?></p>
        <?php do_action('slideshow_deploy', '498'); ?>
    <?php endif; ?>

    Stefan, I congratulate you for a very nice plugin.

    However I must warn you that your latest version suddenly conflicts with other installed plugins. I am having to revert to the previous version that was working really well.

    If you are interested in searching out for the bugs, please let me know, I’d be happy too help.

    Best

    Claudio

    Thanks Stefan! Works Perfect!

    Plugin Author Stefan Boonstra

    (@stefanboonstra)

    Hi Claudio,

    Thanks for reporting your problem with the new version. Would you happen to know which plugin(s) the slideshow is conflicting with? Also, did you get any error messages?

    I’m very sorry for the inconvenience.

    Best regards,
    Stefan

    (I’m glad to hear it works, Lilqhgal!)

    Hello Stefan,

    I apologise for the delay. The plugin in question is called Post Content Shortcodes which allows you to place the content of a post into a page. The newest version of your plugin seems to cause the slideshows to disappear from the posts.

    I hope this helps, but if you need anything further, please let me know.

    Best regards
    Claudio

    Plugin Author Stefan Boonstra

    (@stefanboonstra)

    Hi Claudio,

    The ‘Post Content Shortcodes’ plugin seems to work for me in combination with the slideshow plugin’s version 2.2.1.

    Did you use the standard ‘[post-content id=1]‘ shortcode to get the post to show on your page, or did you use a different shortcode?

    Best regards,
    Stefan

    Hello Stefan,

    That is exactly right. I simply use the code to bring up in a page the content of custom posts.

    This is because I also use easyReservations plugin, which has its own posts that I wanted to show in some pages. I guess that replicating what happened to me would require all 3 plugins to be installed.

    Sorry, I should have mentioned this before.

    Let me know if there is anything I can do to help.

    Best regards
    Claudio

    Plugin Author Stefan Boonstra

    (@stefanboonstra)

    Hi Claudio,

    Again, this combination of plugins works on my website.

    About sixteen hours ago I have released an update to the plugin, which has fixed a problem for many users. The problem caused the slideshow to be hidden and it mainly occurred in Internet Explorer, although in some cases it did as well in Firefox and Chrome.

    Perhaps version 2.2.1 solves your problem as well. If it doesn’t I could have a look at your website right away, as we’re both online at the moment.

    Best regards,
    Stefan

    Hi Stefan,

    Sorry, I’ve only just noticed your message. Strange that things are working for you when they didn’t for me. Clearly my assumption regarding the conflicts must be wrong. I will try uploading your updates and see if it makes any difference. If I still get an error I will try to record the steps so that you can duplicate them. It will probably be monday now if you don’t mind.

    Best regards

    Claudio

    Hello Stefan,

    as promised I’ve taken another look at the plugin.
    Unfortunately I cannot replicate what was giving errors before, so I decided to load your newest version (I like the new features!) and to be honest I’d much rather have your plugin than the other one. The plugin seemns to be working fine. There is only one css comment I’d like to make and that is that the right arrow floats outside of the pictures for some reason.

    If you want you can see your plugin in action here. This site is still under construction but will show you what I mean.

    Best regards

    Claudio

    Plugin Author Stefan Boonstra

    (@stefanboonstra)

    Hi Claudio,

    Your theme’s CSS file sets all images’ width to a maximum width of 97.5%, this is what causes the button to look like it’s falling off.

    I’ve made an adjustment to the slideshow’s functional stylesheet and from version 2.2.2 it will ignore the aforementioned maximum width. The update will be available in a couple of hours.

    I’m glad version 2.2.1 is working on your website now!

    Best regards,
    Stefan

    Well done Stefan,

    I’ve just updated your plugin and it looks great!

    Genius should always be commended…

    Best regards

    Claudio

    Hello Stefan,

    I must congratulate you on your latest work. The plugin really has become a beautiful swan. I am sure you have many more features up your sleeves and I look forward to see what else you are cooking up….

    Meantime I have a question for you: Is there any reason why the slideshow code (even the php form) should not work inside a simple html table?

    Regards

    Claudio

    Sorry.

    You can see an example here: http://casaruffino.com/?page_id=67

    Plugin Author Stefan Boonstra

    (@stefanboonstra)

    Hi Claudio,

    Are you trying to use it in your theme? If so, you should use the PHP snippet instead of the shortcode.

    <?php do_action('slideshow_deploy', '715'); ?>

    If you do have this shortcode in a post or a page, there’s something wrong with WordPress’ shortcode engine.

    Best regards,
    Stefan

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Conditinal statement to display slidshow?’ is closed to new replies.