Crawl optimization redirecting download page to homepage
-
<?php if ( is_single() && has_post_thumbnail() ) : ?> <?php $thumbnail_url = get_the_post_thumbnail_url(); ?> <script> document.querySelector('a.gb-button.gb-button-a368b057').onclick = function(e) { e.preventDefault(); e.stopPropagation(); var imgurl = "<?php echo esc_url( $thumbnail_url ); ?>"; var title_art = "<?php the_title(); ?>"; var url = e.target.getAttribute('href'); var htmlcontent = '<div class="download_container"><div><h1>Downloading...</h1><h3>'+title_art+'</h3><h4>Your download <span id="progressBar"> start in <b></b></span> </h4><div class="notworking" style="display: none">Not working? <a href="'+url+'">Click Here</a> to start download manually</div></div><img src="'+imgurl+'"></div>'; var date = new Date(); date.setTime(date.getTime() + (1 * 24 * 60 * 60 * 1000)); var expires = "expires=" + date.toUTCString(); document.cookie = "downloadpost=" + htmlcontent + "; " + expires + "; path=/"; window.location.href = "/downloading"; } </script> <?php endif; ?>
I added the above code in my theme file for download page countdown and it is working fine on other website without crawl optimization plugin and it is redirecting to homepage instead of download timer page with crawl optimization plugin.
Please Help,
Thanks,
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Crawl optimization redirecting download page to homepage’ is closed to new replies.