WordPress.org

Ready to get started?Download WordPress

Forums

Easing Slider "Lite"
[resolved] Easing Slider in Home Page Only - "Double" Home Page Header (23 posts)

  1. Anthyx
    Member
    Posted 1 year ago #

    Hi,

    I'm new to WordPress, I'm currently using Twentyeleven Theme and Easing Slider.

    It works fine, but since I've tried to get the slider just in the home page header, I get a "double" header: the slider image above and the default header image below.

    This happens just in the home page, all the other page keep their featured image as intended. Please note that if I try to remove image header using the dashboard I get just the slider in the home page, and no images at all in the other pages.

    The actual php code of my header.php looks like this:
    _______________________________________________________
    <?php
    if ( is_home() ) {
    if ( function_exists( "easingsliderlite" ) ) {
    easingsliderlite();
    }
    }
    ?>

    <?php
    // Check to see if the header image has been removed
    $header_image = get_header_image();
    if ( $header_image ) :
    ...
    _______________________________________________________

    I've tried all the other different codes I found in similar posts,
    but the problem remains the same.

    Please help!

    Many thanks in advance.

    A.

    http://wordpress.org/extend/plugins/easing-slider/

  2. MatthewRuddy
    Member
    Plugin Author

    Posted 1 year ago #

    You'll need to use a PHP conditional for this. Use is_home() to check if we are viewing the homepage, on which we will display the slideshow. Then, use the else statement to show the static header image when not on the home page (eg. when is_home() is false).

    At the moment you've coded the slideshow to display on the home page only, and the header image to always be displayed.

  3. Anthyx
    Member
    Posted 1 year ago #

    I don't know PHP at all, just trying to figure how it works: as you said the correct code should be:

    <?php
    if ( is_home() ) {
    if ( function_exists( "easingsliderlite" ) ) {
    easingsliderlite();}
    }
    else
    ?>
    <?php

    At this point I'm just getting crazy to find the right code.
    Again, please help!
    (I promise, I'll study PHP soon!) :-)

  4. MatthewRuddy
    Member
    Plugin Author

    Posted 1 year ago #

    Can you link me to a copy of your header.php file? Don't paste it here, upload it to something like CloudApp or Dropbox and paste the link here for me to download. I'll modify it quickly for you and send you back the fixed version.

  5. Anthyx
    Member
    Posted 1 year ago #

  6. MatthewRuddy
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks. Try the modified version of the file below.

    http://cl.ly/code/1Y270A203h2N

  7. Anthyx
    Member
    Posted 1 year ago #

    Fixed a little typo (":" instead of "{") ... it works perfectly!

    Since I found that other people is interested in the topic, here is the code to be inserted in the default header.php:

    $header_image = get_header_image();
    if ( is_home() ) {
    if ( function_exists( 'easingsliderlite' ) ) {
    easingsliderlite();}
    }
    else if ( $header_image ) :
    // Compatibility with versions of WordPress prior to 3.4.
    if ( function_exists( 'get_custom_header' ) ) {

    Many many thanks for your help Matthew!

    Ciao

    A.

  8. MatthewRuddy
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks, and my apologies for the typo! Great to hear it is all working :)

  9. KerimD
    Member
    Posted 1 year ago #

    How i can add slider in a Local Business wordpress template? I tryed so many times but with no succes. Thanks.

  10. MatthewRuddy
    Member
    Plugin Author

    Posted 1 year ago #

    Hi @KerimD, that's not really a question I can properly answer. All WordPress themes differ in their design, so I wouldn't have a clue on the best way to implement Easing Slider into your theme. Depends on the coding & file structure.

    Regardless, if you are trying to insert the slideshow directly into a theme file, use the PHP function. Otherwise, if you are using it inside a WordPress post, use the shortcode. See here for more information.

  11. Anthyx
    Member
    Posted 1 year ago #

    Excuse me Matthew,

    using the "Reading" submenu of "Settings" in Twentyeleven, I have set a normal page (called "Home") as the main, static page.
    I have created another static page, calling it "blog", and using the "Reading" menu I have set it as the post page.

    Now the slider points to "Blog", probably because it's the old, let's say "main post page". The new static main page (called by me "Home") has no slider.

    Is it possible to redirect the slider both to the post page and the new static home page?

    The code is:
    _______
    if ( is_home() ) {
    if ( function_exists( 'easingsliderlite' ) ) {
    easingsliderlite();}
    }
    else if ( $header_image ) :
    // Compatibility with versions of WordPress prior to 3.4.
    if ( function_exists( 'get_custom_header' ) ) {
    _______

    I suppose it's just a question to add another "if" variable, but which? How?
    I suppose that "home" in the code is right now most probably the real name of the "Blog" static page I created, and that's fine.
    How can I "redirect" the slider also to the "static" home paga called "Home" I just created?

    Many thanks in advance for your patience.

    A.

  12. MatthewRuddy
    Member
    Plugin Author

    Posted 1 year ago #

    Try changing is_home() to is_front_page(). Does that work?

  13. Anthyx
    Member
    Posted 1 year ago #

    Yes, it works: now the static "Home" displays the slider, the blog page (aka the "real" home") does not. Do you think is possible to add both "is_home()" and "is_front_page()" to the code? (leaving, of course, the featured image to all other pages and posts).

  14. MatthewRuddy
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, try changing is_front_page() to is_home() && is_front_page().

  15. Anthyx
    Member
    Posted 1 year ago #

    Nope, it does not work ... if I put both of them, linked by "&&", the slider does not work.
    It works just using "is_home()" OR "is_front_page()". Strange ... any idea?

  16. Anthyx
    Member
    Posted 1 year ago #

    FOUND! ... I put "or" instead od "&&" and it works!

    Many many thanks again for your help Matt!

    A.

  17. KerimD
    Member
    Posted 1 year ago #

    I try to place the slider in the homepage of the Local Buesness them from InkThemes.com version 1.1.8. The slider should be display instead of Top Feature Image. When I went to editor, frontpage php I found this code
    ====================================================================

    <div class="flexslider">
    <ul class="slides">
    <?php
    //The strpos funtion is comparing the strings to allow uploading of the Videos & Images in the Slider
    $mystring1 = localbusiness_get_option('localbusiness_slideimage1');
    $value_img = array('.jpg', '.png', '.jpeg', '.gif', '.bmp', '.tiff', '.tif');
    $check_img_ofset = 0;
    foreach ($value_img as $get_value) {
    if (preg_match("/$get_value/", $mystring1)) {
    $check_img_ofset = 1;
    }
    }
    // Note our use of ===. Simply == would not work as expected
    // because the position of 'a' was the 0th (first) character.
    ?>
    <?php if ($check_img_ofset == 0 && localbusiness_get_option('localbusiness_slideimage1') != '') { ?>

  18. <?php echo localbusiness_get_option('localbusiness_slideimage1'); ?>
  19. <?php } else { ?>

  20. <?php if (localbusiness_get_option('localbusiness_slideimage1') != '') { ?>
    "><img src="<?php echo localbusiness_get_option('localbusiness_slideimage1'); ?>" alt=""/>
    <?php } else { ?>
    <img src="<?php echo get_template_directory_uri(); ?>/images/signupimg.jpg" alt=""/>
    <?php } ?>
    =======================================================================

    Which should php code of the easing slider be pasted?

    thanks

  • MatthewRuddy
    Member
    Plugin Author

    Posted 1 year ago #

    Again @KerimD, this is really of no use to me. The code is hard to read on the forum and it isn't possible to just say "that's the place to put it". It really varies from theme to theme and requires a deeper understanding to what is going on and how the theme has been structured.

    I think you'd be much better off contacting the developer(s) of the theme, or having a freelance developer make the modifications for you.

  • fashioncandyboutique
    Member
    Posted 1 year ago #

    Ok i tried to add this slider to all my pages. I kno its the same slider on every page. But it doubled on the home page. How can i stop this from happening?

  • MatthewRuddy
    Member
    Plugin Author

    Posted 1 year ago #

    Hi @fashioncandyboutique, I'm not sure what could be occurring. Make sure you haven't also added the slideshow code into a home-page specific theme file. You could also give contacting the theme developer a try - I'm sure they could help show you the correct place to insert the code :)

  • NorthEndCoder
    Member
    Posted 10 months ago #

    Hey guys and girls. I am having some trouble with wordpress and i want to have a image slider displayed on my homepage only. and have it between the header text and the content box.

    is there anyone who knows a easy way to do this?

    thanks.

  • MatthewRuddy
    Member
    Plugin Author

    Posted 9 months ago #

    Hi @NorthEndCoder, could you start a new topic regarding this? I'd be happy to help you there :)

  • NorthEndCoder
    Member
    Posted 9 months ago #

    oh ok one second.

  • Topic Closed

    This topic has been closed to new replies.

    About this Plugin

    About this Topic

    Tags