- This topic has 3 replies, 2 voices, and was last updated 3 years, 7 months ago by David.
-
AuthorPosts
-
September 16, 2020 at 7:19 am #1445695Matthew
Hi. I’m using GP Premium 1.10 at this point, with 2.42 theme and WP 5.5.1.
I have the following code block in the “After Header” section of GP Hooks:
—-
<?php if ( is_front_page() ) : ?><h1>Do You Care About East Lansing?</h1><p style=”font-size: 1.375rem;”>Public Response is a community forum that allows citizens to voice their ideas, concerns, and opinions, and encourages transparency of local government through essays that are submitted.</p><?php do_action(‘mo_optin_form’, ‘uFePSBlGCz’); ?>
<style>
.jumbotron {
color: inherit;
background-color: #aaa;
background-blend-mode: multiply;
background-repeat: no-repeat;
background-size: cover!important;
background-position: center 48%;
padding-bottom: 1.25rem;
position: relative;
text-align: center;
}.jumbotron-overlay {
padding: 1rem 0;
position: relative;
z-index: 99;
}.jumbotron h1 {
color: #fff;
font-size: 2rem;
letter-spacing: -1px;
margin: 0;
padding: 1rem 0;
text-shadow: 0 0 8px rgba(0,0,0,.325);
}.jumbotron-container-content {
color: #fff;
margin: 0 auto;
padding: .5rem;
width: 100%;
}
@media (min-width: 470px) {
.jumbotron-container-content {
width: 84%;
}
}.link-essays {
color: #fff !important;
padding-bottom: 2px;
border-bottom: 3px solid;
}.link-essays:hover {
color: #e19251 !important;
}#uFePSBlGCz .gridgum_header2, #uFePSBlGCz .gridgum_headline {
font-size: 1.125rem;
}#uFePSBlGCz input {
display: block;
margin-bottom: .5rem;
margin-left: auto;
margin-right: auto;
}
@media (min-width: 550px) {
#uFePSBlGCz input {
display: inline-block;
}
}#uFePSBlGCz .gridgum_note {
font-size: .75rem;
}#uFePSBlGCz .mo-optin-error {
color: #f47149;
display: none;
}#uFePSBlGCz .mo-optin-fields-wrapper {
margin-top: 1rem;
}#uFePSBlGCz .mo-optin-form-headline {
padding: 1rem 0 .5rem 0;
}</style>
<script type=”text/javascript”>
jQuery(function($) {
var images = [‘jumbotron_00.jpg’, ‘jumbotron_01.jpg’, ‘jumbotron_02.jpg’, ‘jumbotron_03.jpg’, ‘jumbotron_04.jpg’, ‘jumbotron_05.jpg’, ‘jumbotron_06.jpg’, ‘jumbotron_07.jpg’, ‘jumbotron_08.jpg’, ‘jumbotron_09.jpg’, ‘jumbotron_10.jpg’, ‘jumbotron_11.jpg’, ‘jumbotron_12.jpg’, ‘jumbotron_13.jpg’];
$(‘.jumbotron’).css({‘background-image’: ‘url(wordpress/wp-content/uploads/2018/04/’ + images[Math.floor(Math.random() * images.length)] + ‘)’});
});
</script><?php endif; ?>
—-So this was (as far as I know) only appearing and still should be appearing on only the home page, but it is now appearing on other (archive) pages on the site. The home page is https://publicresponse.com (where it should appear), but then it’s on pages like https://publicresponse.com/page/2/ .
Any idea what the problem may be?
Thank you.
-Matt Kazmierski
September 16, 2020 at 7:39 am #1445719DavidStaffCustomer SupportHi there,
use this for your template condition:
if ( is_front_page() && !is_paged() )
September 16, 2020 at 7:46 am #1445726MatthewThat worked. Thank you very much David.
Best,
MattSeptember 16, 2020 at 7:47 am #1445729DavidStaffCustomer SupportYou’re welcome
-
AuthorPosts
- You must be logged in to reply to this topic.