Site logo

Archived topic

Navigation Is Really Long

42 replies · Started by Terrell Jerry on September 7, 2017

Viewing posts 16–30 of 43

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.

Both of them are causing the problem?

Just trying to narrow it down.

Can you try adding one only and then the other?

Thanks!

Okay, explain how to add then one another?

So 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?

Also I think we only helped with the conditional statements. Where did the Script come from? Maybe it's causing the issue?

Okay, where can I get another script that's compatible.

Which 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?

Tom

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.

That 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?

The 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.

Where you want the first snippet to show up? After the header?

Yes, 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.

Try 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;
}

That worked Tom but it's showing on the homepage. How do we stop that from showing on the homepage I mean any banners?

Also, stop it from showing on about and contact page.

This archived topic is closed to new replies.