- This topic has 29 replies, 3 voices, and was last updated 8 years, 2 months ago by Tom.
-
AuthorPosts
-
February 18, 2016 at 3:00 am #173581Frederik
…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.deFebruary 18, 2016 at 4:37 am #173591SvenHi 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
February 18, 2016 at 4:39 am #173592Sven@Frederik: perhaps you can send me your adjustments in meta-slider for the slideshow on your starting page…?
webmaster at fudiggl dot deFebruary 18, 2016 at 8:14 am #173618FrederikSven,
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 8 years, 2 months ago by Frederik.
February 18, 2016 at 8:57 am #173630SvenHi 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?!
????
February 18, 2016 at 9:55 am #173636TomLead DeveloperLead DeveloperAny language is good! Google Translate is awesome 🙂
Any chance you can post a link to your site?
February 18, 2016 at 10:10 am #173638SvenFebruary 18, 2016 at 10:15 am #173645SvenCustom 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’);
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;
}February 18, 2016 at 10:48 am #173655TomLead DeveloperLead DeveloperWhere did you add the slider? I’m not seeing it in the source.
February 18, 2016 at 10:49 am #173657Svenhooked 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; ?>
February 18, 2016 at 10:50 am #173659TomLead DeveloperLead DeveloperTry 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.
February 18, 2016 at 10:53 am #173661SvenA W E S O M E ! ! !
:-*
February 18, 2016 at 11:28 am #173669Frederikwell done, TOM! Good to know that Home is not always Home !
February 18, 2016 at 11:36 am #173670SvenThank you both for your efforts! It’s working now… you can have a look at:
(I’m one of the drummers)
Best wishes to you!
Sven
February 18, 2016 at 4:27 pm #173731TomLead DeveloperLead DeveloperSite 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.
-
AuthorPosts
- You must be logged in to reply to this topic.