[Resolved] fixed header-slider in background

Home Forums Support [Resolved] fixed header-slider in background

Home Forums Support fixed header-slider in background

Viewing 15 posts - 16 through 30 (of 30 total)
  • Author
    Posts
  • #173581
    Frederik

    …just did soe more testing and found a possible solution (maybe quick&dirty, but seems to work)

    added following code to GP-hook BEFORE HEAD

    <?php if (is_front_page() and is_home() ) : ?>
    <div id="metaslider-background" style="position:fixed;width:100%;height:100%;z-index:-1;top:0;left:0;">
    <?php echo do_shortcode("[metaslider id=123 percentwidth=100]"); ?>
    </div>
    <?php endif; ?><div id="content-pushdown" style="width:100%;height:100vh;top:0;left:0;">
    </div>

    im am not sure if i really like it, but anyway already implemented here:
    http://dogsbestfriends.de

    #173591
    Sven

    Hi Frederik,

    thank your for your help!

    Actually I installed the metaslider plugin and added a diashow. Also hooked your code (with the correct slider-ID)… BUT: the metaslider does not appear in the background of my start page – no matter where I hook the code!

    It’s obvious, that the code has an impact on the page: depending where I hook it, the starting text (in green letters: “fudiggl.de gugge…”) goes to different places. Only the slider does not appear!

    On a regular page the slider itself works normally… so the plugin works and the ID is correct, too.

    Any idea(s)/suggestion(s)?

    Sven

    #173592
    Sven

    @Frederik: perhaps you can send me your adjustments in meta-slider for the slideshow on your starting page…?
    webmaster at fudiggl dot de

    #173618
    Frederik

    Sven,

    hast du im GP-Hook das Häkchen gesetzt, dass auch php-code verarbeitet wird ?

    und im code musst du den string <?php endif; ?> verschieben und ganz ans Ende setzen, sonst wird auch bei allen anderen Seiten der eigentliche Inhalt der Webseite nach unten veschoben.

    • This reply was modified 5 years, 7 months ago by Frederik.
    #173630
    Sven

    Hi Frederik,

    let’s stay in English, please, so Tom can follow…

    The GP-hook-section is activated, so the PHP-Code works (as mentioned above: depending where I hook your code (before-header, in-header, in-content et. al.) the start page changes. But the slider does not show up in the background! There only is the standard background image I have set for any page.

    I don’t see how to put the <?php endif; ?> at the end… with your code it already is at the end!

    Can it be a problem with the slider itself? I have already tried another slider plugin…same problem. So I assume, I have to play around with some PHP-code or CSS?!

    ????

    #173636
    Tom
    Lead Developer
    Lead Developer

    Any language is good! Google Translate is awesome 🙂

    Any chance you can post a link to your site?

    #173638
    Sven
    #173645
    Sven

    Custom CSS, that perhaps/certainly affects the background:

    /* set beackground texture */
    body {
    background-image:url(‘http://www.fudiggl.de/wp-content/uploads/betonwand_hintergrund-1.jpg&#8217;);
    background-repeat:repeat;
    background-attachment:scroll;
    background-clip:border-box;
    background-position: 0px 0px;
    background-size: auto;
    }

    /* Hide menu on start page (id = nnn) and show when scrolling as recommended by Tom */
    .page-id-nnn .main-navigation {
    display: none;
    }
    .page-id-nnn .main-navigation.navigation-clone {
    display: block;
    }

    #173655
    Tom
    Lead Developer
    Lead Developer

    Where did you add the slider? I’m not seeing it in the source.

    #173657
    Sven

    hooked it before the header:

    <?php if ( is_front_page() and is_home() ) : ?>
       <div id="metaslider-background" style="position:fixed; width:100%; height:100%; z-index:-1; top:0;l eft:0;">
          <?php echo do_shortcode("[metaslider id=6490 percentwidth=100]"); ?>
       </div>
    <?php endif; ?>
    #173659
    Tom
    Lead Developer
    Lead Developer

    Try this:

    <?php if ( is_front_page() ) : ?>
       <div id="metaslider-background" style="position:fixed; width:100%; height:100%; z-index:-1; top:0;l eft:0;">
          <?php echo do_shortcode("[metaslider id=6490 percentwidth=100]"); ?>
       </div>
    <?php endif; ?>

    And make sure “Execute PHP” is checked.

    #173661
    Sven

    A W E S O M E ! ! !

    :-*

    #173669
    Frederik

    well done, TOM! Good to know that Home is not always Home !

    #173670
    Sven

    Thank you both for your efforts! It’s working now… you can have a look at:

    http://www.fudiggl.de

    (I’m one of the drummers)

    Best wishes to you!

    Sven

    #173731
    Tom
    Lead Developer
    Lead Developer

    Site looks great!

    is_home() is kind of misleading – it applies to the “posts page” or blog of your site, not necessarily the home page.

    It’s an old function that WP keeps around for backwards compatibility.

Viewing 15 posts - 16 through 30 (of 30 total)
  • You must be logged in to reply to this topic.