- This topic has 42 replies, 3 voices, and was last updated 6 years, 7 months ago by Tom.
-
AuthorPosts
-
September 8, 2017 at 2:35 pm #381968Terrell Jerry
It was the two you told me to disable. I got the code from Tom.Is there another way I can use both of those codes.
September 8, 2017 at 2:46 pm #381975LeoStaffCustomer SupportBoth of them are causing the problem?
Just trying to narrow it down.
Can you try adding one only and then the other?
Thanks!
September 8, 2017 at 3:52 pm #382000Terrell JerryOkay, explain how to add then one another?
September 8, 2017 at 4:03 pm #382003LeoStaffCustomer SupportSo currently you removed both blocks of code the problem is fixed.
So try adding the first one back in, does the problem reappear?
If not then remove the first one, add in the second, does the problem reppear?
September 8, 2017 at 4:06 pm #382004LeoStaffCustomer SupportAlso I think we only helped with the conditional statements. Where did the Script come from? Maybe it’s causing the issue?
September 8, 2017 at 4:19 pm #382012Terrell JerryOkay, where can I get another script that’s compatible.
September 9, 2017 at 12:25 am #382131TomLead DeveloperLead DeveloperWhich exact snippet is causing the issue?
Out of the three, only one of them should be breaking things. Have you narrowed down which one is the problem?
September 9, 2017 at 8:09 am #382334Terrell JerryTom
Stop banners from showing on the homepage. Causing the problems on my website!
if ( ! is_front_page() ) : ?><script data-oio-zone=”type=banner&zone=2&align=center&refresh=0″> (function(w,d,e,o,u,s,t){w[o]||(w[o]={},s=d.createElement(e),s.src=u,s.async=1, t=d.getElementsByTagName(e)[0],t.parentNode.insertBefore(s,t))})(window,document, “script”,”oiopub”,”https://zippsurge.com/wp-content/plugins/oiopub-direct/zones.js”); </script> <?php endif;
Make banner show up on the blog and single post with sections active.
add_action( ‘generate_before_main_content’,’tu_blog_banner’ );
function tu_blog_banner() {
if ( is_home() || is_single() ) {
?>
<script data-oio-zone=”type=banner&zone=2&align=center&refresh=0″>
(function(w,d,e,o,u,s,t){w[o]||(w[o]={},s=d.createElement(e),s.src=u,s.async=1,
t=d.getElementsByTagName(e)[0],t.parentNode.insertBefore(s,t))})(window,document,
“script”,”oiopub”,”https://zippsurge.com/wp-content/plugins/oiopub-direct/zones.js”);
</script>
<?php
}
}Thank you for responding back so fast.
September 9, 2017 at 10:45 am #382400TomLead DeveloperLead DeveloperThat first snippet isn’t hooked into anywhere (no add_action()).
It needs to be hooked into a certain area or else your site will break. Where do you want the banner to show up?
September 9, 2017 at 2:52 pm #382479Terrell JerryThe first snippet I don’t want banners to show up on the homepage. The last snippet I only want it to show up on blog page and single post with sections active.
September 10, 2017 at 12:20 am #382602TomLead DeveloperLead DeveloperWhere you want the first snippet to show up? After the header?
September 10, 2017 at 10:20 am #382826Terrell JerryYes, I want the first snippet to show up in the container area. The second snippet on the blog and single post container. Also, I want both to show up when sections are enabled.
September 10, 2017 at 10:19 pm #383045TomLead DeveloperLead DeveloperTry this instead of the first snippet:
add_action( 'generate_after_header', 'tu_insert_script_after_header' ); function tu_insert_script_after_header() { if ( ! is_front_page() ) : ?> <script data-oio-zone="type=banner&zone=2&align=center&refresh=0"> (function(w,d,e,o,u,s,t){w[o]||(w[o]={},s=d.createElement(e),s.src=u,s.async=1, t=d.getElementsByTagName(e)[0],t.parentNode.insertBefore(s,t))})(window,document, "script","oiopub","https://zippsurge.com/wp-content/plugins/oiopub-direct/zones.js"); </script> <?php endif; }
September 11, 2017 at 6:19 am #383174Terrell JerryThat worked Tom but it’s showing on the homepage. How do we stop that from showing on the homepage I mean any banners?
September 11, 2017 at 6:20 am #383175Terrell JerryAlso, stop it from showing on about and contact page.
-
AuthorPosts
- You must be logged in to reply to this topic.