WordPress.org

Forums

Meteor Slides
[resolved] I want Meteor Slides to only show up on the home page. (14 posts)

  1. Pfat_Pat
    Member
    Posted 4 years ago #

    Hey everyone,

    I want the Meteor Slides to only show up on the home page. Not when people click through to pages 2, 3, 4, etc...or any other pages created. My site is slopnessmonster.com. Any help is greatly appreciated!

    http://wordpress.org/extend/plugins/meteor-slides/

  2. Josh Leuze
    Member
    Plugin Author

    Posted 4 years ago #

    Are you using the template tag?

    You could use this conditional to only load the slideshow on the homepage:

    <?php if { is_front_page() ) {
    
    if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow(); }
    
    }?>
  3. Pfat_Pat
    Member
    Posted 4 years ago #

    Post that in the page.php? This was the code that was in there:

    <?php if ( is_front_page() ) { ?>
    <?php if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow(); } ?>

    I replaced it with the code you provided but it didn't work.

  4. Josh Leuze
    Member
    Plugin Author

    Posted 4 years ago #

    Sorry, there was a typo in there, try this:

    <?php if ( is_front_page() ) {
    
    if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow(); }
    
    }?>

    But the code that you had in there should work, was there a closing curly brace after that like this?

    <?php }?>
  5. Pfat_Pat
    Member
    Posted 4 years ago #

    So with this code, how do I only display slides on the home page? I already had that code in my page.php, but it still displayed on all pages

  6. Josh Leuze
    Member
    Plugin Author

    Posted 4 years ago #

    That code should work, I just tested it. But are you sure you're loading this from your page.php file? That is for pages, not posts or index pages. Your homepage doesn't use page.php, it looks to me like you have the slideshow tag in your header.php file.

  7. Pfat_Pat
    Member
    Posted 4 years ago #

    Beautiful, that worked! you were right, I was looking in the wrong place...how do I keep it from showing when page 2, 3, 4 are clicked from the homepage?

  8. Josh Leuze
    Member
    Plugin Author

    Posted 4 years ago #

    Oh, try using this:

    <?php if ( is_front_page() && !is_paged() ) {
    
    	if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow(); }
    
    }?>
  9. Pfat_Pat
    Member
    Posted 4 years ago #

    Great! Thank you! While I have you, I'm also trying to keep the watermark from showing up on the slides. Anything that is uploaded through the wordpress uploader will be watermarked from the code I have in place...I know if I put the image on my server and grab it through the URL option, the watermark will not show. This option doesn't work with Meteor slides, The Image Title will still have an asterisk even when I fill in the title...and there is no button to save or publish. Am I doing something wrong? is there a work around where I can keep the watermark showing up when still using the uploader?

  10. Josh Leuze
    Member
    Plugin Author

    Posted 4 years ago #

    No problem. The slide images have to be stored in the WordPress media library because they are featured images and not images inserted into a post.

    Are you using a plugin to add the watermarks. I would think that some of these plugins would give you the option to exclude certain images. Or the simplest option might be to just disable that plugin when you are uploading slides.

  11. Pfat_Pat
    Member
    Posted 4 years ago #

    I'm actually using this method, http://bit.ly/1jGsKm. So I guess there's no way around it. I couldn't find a plug-in either. No problem though. Thanks for your help!

  12. Josh Leuze
    Member
    Plugin Author

    Posted 4 years ago #

    Yeah, it would be tricky with a script that ran outside of WordPress.

    But I think you should be able to find a good watermark plugin for WordPress. Check out the Watermark RELOADED plugin. With that plugin you can apply the watermark to just certain image sizes, so you could exclude thumbnails, which are the images that Meteor Slides uses, and still have the watermark applied to all the other images on your site.

  13. Cor van Noorloos
    Member
    Posted 4 years ago #

    I just started using Meteor Slides, therefore I hope it would be OK asking this many questions all at one (:

    Would it be possible to use if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow(); somehow to see/exclude when things (meaning javascript) are loaded on pages when not using the plugin?

    I hope this snippet will explain my question a bit what I'm referring to (etalage being the only page the plugin is loading)

    function cor_wp_print_scripts() {
    	if (!is_admin() && !is_page('etalage')) {
    		wp_deregister_script('jquery');
    	}
    	if (!is_admin() && !is_page('etalage') && !is_single()) {
    		wp_deregister_script('l10n');
    	}
    }
    add_action('wp_print_scripts', 'cor_wp_print_scripts', 100);

    Without this, all needed js is loading on every page, without being needed.

    As a side-note, I'm not using jQuery for anything other than this plugin

  14. Josh Leuze
    Member
    Plugin Author

    Posted 4 years ago #

    Eventually this is how Meteor Slides will work, but I'm still trying to figure out the best way to do this dynamically.

    It should be simpler for you to do manually though when you only need the scripts on a few pages.

    I wouldn't deregister jQuery though, it's so widely used that you never know when another plugin you are using might decide to use it for something.

    I would try removing the actions in Meteor Slides that enqueue all the JavaScript and CSS, meteorslides_css and meteorslides_javascript.

    Try something like this in your functions.php file:

    if (!is_page('etalage')) {
    		remove_action( 'wp_print_scripts', 'meteorslides_javascript' );
    	}

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic