Slide showing on page it shouldn't be
-
I manage an existing website for a client. They have a slider on their homepage. The theme is BHINNIKA, fluid responsive. The home page slider is used within the theme.
I added the meteor slides so I could add a slide show to another page on the site. The slider is used only on this page however, the three images I used are now showing up on the homepage slider as well and shouldn’t.
Is there anyway I can modify the short code to only show these three images on this one page.
Corey
-
Hi Corey, can you post a link to the page you’re working on, and the shortcode you are using?
Hi Josh.
The page the shortcode is on is: https://www.notredameschool.org/academics-admissions/job-sites/
The shortcode used is:[meteor_slideshow] I only created that one slide show.If you look at the home page https://www.notredameschool.org/ you can see the three images that I use on job site page is showing up in slider. Also when I look at the images that I added to the meteor slide show, the images used in the header show up in this gallery but they are not assigned to the slide show. Does that make sense.
Corey
I couldn’t say for sure without seeing the code, but it looks to me like that theme is already registering it’s own “slide” post type that is conflicting with the slides for Meteor Slides.
Really a theme shouldn’t be managing a post type like this, but you could switch the theme’s slides to use a different unique post type.
Or you could consolidate your slideshows and use just one slideshow solution for all of your slideshows, that would be the most efficient way. You could switch the homepage slideshow to Meteor Slides, or extend the homepage slideshow functionality to work on multiple slideshow, but I don’t know if your theme is really setup to handle that.
Josh thanks for your feedback on this. I’ve never had a problem using meteor slides so definitely something with the theme. What’s really weird is the three images that are being used on the home page slider are in my meteor slide gallery. Before I installed the plugin, I’m not real sure where they were. I looked through everything. What would be the best way to do this. I’m not the best at coding. The first place I looked was at the header.php. I then looked at the home page template. It’s the only page using this template and the only page that has the slider in the header. In the header.php, I found the string. Would this be code that is drving the home page slider? <?php if(is_page_template(‘template-home.php’)) { include ‘lib/slide-home.php’; } // Get slide if it is Home Page ?> I tried replacing the ‘lib/slide-home.php’ with the meteor shortcode but it didn’t work. Any ideas?
Corey
Here is the code for slide-home.php
<div class="slider-container row"> <!-- SLIDER BEGIN --> <?php if ($data['bnk_slider_alt_control'] == '0') { ?> <div class="flexslider col_16"> <?php } else { ?> <div class="flexslider mobile-hide col_16"> <?php } ?> <ul class="slides"> <?php $query = new WP_Query(); $query->query('post_type='.__( 'slide' ).'&posts_per_page=-1'); if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); $caption = get_post_meta(get_the_ID(), 'bnk_image_caption', true) ; $url = get_post_meta(get_the_ID(), 'bnk_image_url', true) ; if ($url != "" ) { ?> <li> <a>" ><?php the_post_thumbnail( 'slide-image' , array('title' => $caption) ); ?></a> <?php if ($caption ) { ?> <p class="flex-caption"><?php echo $caption; ?></p> <?php } ?> </li> <?php } else { ?> <li> <?php the_post_thumbnail( 'slide-image' , array('title' => $caption) ); ?> <?php if ($caption ) { ?> <p class="flex-caption"><?php echo $caption; ?></p> <?php } ?> </li> <?php } ?> <?php endwhile; endif; // loop end?> </div> <!-- SLIDER END --> <?php if ($data['bnk_slider_alt_control'] == '1' ) { ?> <!-- ALTERNATIVE TEXT BEGIN This will replace the Slider on mobile version --> <div class="mobile-only col_16" id="slider-mobile"> <h1 class="seriftype respond_1 textcenter"><?php echo $data['bnk_slider_alt'] ?></h1> </div> <!-- ALTERNATIVE TEXT END --> <?php } ?> </div>
Thanks for cleaning that up Ipstenu!
Yes, this is using the same post type as Meteor Slides. You could use Meteor Slides for that slideshow, but you have to use the template tag in your theme files rather than the shortcode, which only works in the post editor.
You can replace this code:
<?php if(is_page_template('template-home.php')) { include 'lib/slide-home.php'; } // Get slide if it is Home Page ?>
With this code:
<?php if(is_page_template('template-home.php')) { if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow(); } } // Get slide if it is Home Page ?>
But you would need to set the slideshow dimensions in the slideshow settings to match the dimensions of the current homepage slideshow and then setup a new homepage slideshow in Meteor Slides. You can do this by using multiple slideshows.
Let me know if you have any questions or problems making that change.
I will give this a try. Thanks Josh really appreciate it.
I’ll let you know how it turned out.
Corey
So to make sure, using this code in place of the other on the homepage and to isolate it to use the new home slide show I created “home-header”, would it look like this then?
<?php if(is_page_template(‘template-home.php’)) { if ( function_exists( ‘meteor_slideshow’ ) ) { meteor_slideshow( ‘home-header’ ); } } // Get slide if it is Home Page ?>
Then on the job site page it would be [meteor_slideshow slideshow=”job-sites”]
Or would I need to beusing the slideshow ID?
I tried this but the slide show was not in the same place as it is with the original. It was pushed over to the left. I undid so I can try this evening when it’s late and no one is browsing.
Corey
Yeah, that’s right you want to specify a slideshow like that, for the template tag, make sure you include the custom metadata parameter, even if it’s blank:
<?php if(is_page_template('template-home.php')) { if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow( "home-header", "" ); } } // Get slide if it is Home Page ?>
You might need to use some metadata though to change the slideshow alignment and center the slideshow in that space like this:
<?php if(is_page_template('template-home.php')) { if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow( "home-header", "align: 'center'" ); } } // Get slide if it is Home Page ?>
That did the trick however, how to I move the slide show up in the header where it’s above the “The Notre Dame School of Dallas” Graphic?
Corey
You can add some extra padding and margin to the bottom of the slideshow to lay it out like that. Try adding this to your theme’s stylesheet:
#header #meteor-slideshowhome-header { margin-bottom: 50px; padding-bottom: 30px; } #header #meteor-slideshowhome-header .meteor-buttons { bottom: 10px; }
You are awesome! Thanks Josh. That did the trick.
Corey
- The topic ‘Slide showing on page it shouldn't be’ is closed to new replies.