-1

I am using meteor-slides plugin to make header as a slideshow. I am using twenty-eleven theme. Now i need to make this slideshow for my homepage only and featured images of other pages as headers for the respective pages. Can anyone help me with this?

2 Answers 2

0

In your header.php check if you are an the front page:

if ( is_front_page() or is_home() )
{
    # your slider code here
}
else
{
    # your regular code
}

The front page is the top page, eg. http://example.com/. The home page is the page for your blog posts. That can be the same as your front page or a custom page like http://example.com/news/. See Settings/Reading in WP admin.

2
  • But how does that display the featured image as the header image on any page or post? Jan 5, 2014 at 14:42
  • @BradDalton By putting the regular featured image code into the else block?
    – fuxia
    Jan 5, 2014 at 14:44
0

I have got answer for it. I have changed the code to add meteor slides plugin in functions.php to show the slideshow just in the homepage.

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

After that i used a plug called WP display header to set header image for each page

1
  • But how does that hook the slider into the header from your functions file when there's no header hook in the code? Jan 5, 2014 at 12:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.