11-06-2016, 03:44 PM
I'd like to add a 728x90 leaderboard script to display only on my Wordpress front page. I just want to know where to add is_front_page() tag to the script below. I read https://wordpress.stackexchange.com/ques...al-problem and https://codex.wordpress.org/Function_Ref...front_page
I currently have the following in functions.php file:
I currently have the following in functions.php file:
Code:
add_action('__before_main_container' , 'display_leaderboard');function display_leaderboard() { ?>
<center> <!--728x90-->
<script id="mNCC" language="javascript">
medianet_width = "728";
medianet_height = "90";
medianet_crid = "1111111111";
medianet_versionId = "111111";
(function() {
var isSSL = 'https:' == document.location.protocol;
var mnSrc = (isSSL ? 'https:' : 'http:') + '//contextual.media.net/nmedianet.js?cid=1111111' + (isSSL ? '&https=1' : '');
document.write('<scr' + 'ipt type="text/javascript" id="mNSC" src="' + mnSrc + '"></scr' + 'ipt>');
})();
</script>
</center> <?php }