WordPress.org

Ready to get started?Download WordPress

Forums

Slideshow
[resolved] Conditinal statement to display slidshow? (18 posts)

  1. lilqhgal
    Member
    Posted 1 year ago #

    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/

  2. Stefan Boonstra
    Member
    Plugin Author

    Posted 1 year ago #

    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; ?>
  3. cingrosso
    Member
    Posted 1 year ago #

    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

  4. lilqhgal
    Member
    Posted 1 year ago #

    Thanks Stefan! Works Perfect!

  5. Stefan Boonstra
    Member
    Plugin Author

    Posted 1 year ago #

    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!)

  6. cingrosso
    Member
    Posted 1 year ago #

    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

  7. Stefan Boonstra
    Member
    Plugin Author

    Posted 1 year ago #

    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

  8. cingrosso
    Member
    Posted 1 year ago #

    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

  9. Stefan Boonstra
    Member
    Plugin Author

    Posted 1 year ago #

    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

  10. cingrosso
    Member
    Posted 1 year ago #

    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

  11. cingrosso
    Member
    Posted 1 year ago #

    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

  12. Stefan Boonstra
    Member
    Plugin Author

    Posted 1 year ago #

    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

  13. cingrosso
    Member
    Posted 1 year ago #

    Well done Stefan,

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

    Genius should always be commended...

    Best regards

    Claudio

  14. cingrosso
    Member
    Posted 1 year ago #

    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

  15. cingrosso
    Member
    Posted 1 year ago #

    Sorry.

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

  16. Stefan Boonstra
    Member
    Plugin Author

    Posted 1 year ago #

    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

  17. cingrosso
    Member
    Posted 1 year ago #

    Yes I tried that Stefan, but did not work either. However I have found out what the problem is. I was using <!--raw--> tags which disabled any shortcode in the page, including yours.

    May be useful to know for others. I have been struggling with WP inherent ability to change my html and tried to bypass the system using the above tags, but to no avail since things keep changing anyway.

    I suppose the bottom line is: there is nothing wrong with your plugin!

    Regards

    Claudio

  18. Stefan Boonstra
    Member
    Plugin Author

    Posted 1 year ago #

    I'm glad to hear you were able to figure it out!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.