• Resolved mmangar

    (@mmangar)


    I bought the Huex theme a while back and I’m trying to add a 728×90 banner on the single post pages instead of the default 468×60 above the header.

    For example take a look at Ryans blog: https://blog.ryanmaffit.com/web-development/php/dynamic-php-font-generator.html

    Using Firebug I found that ryan created a custom div class called Advert-728, I tried to copy the coding into my single.php file but I always get it wrong. If anyone is familiar with Firebug I would very much appreciate intructions on how to copy the Advert-728 div class into my single.php file

    This is what the header of my single.php file looks like:

    <?php get_header(); ?>
    
    <!-- Left // -->
    <div class="left">
    
    	<?php if(get_wpn_config('ad_468')) : ?>
    	<div class="advert-468">
    		<?php echo stripslashes(get_wpn_config('ad_468')); ?>
    	</div>
    	<?php endif; ?>

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • that ryan actually included his banner code into header.php; it could help if you copy the header.php code into a https://wordpress.pastebin.com/ and post the link to it here.

    if you only want it to show in single posts (single.php) you could use the conditional template tag ‘is_single()’
    https://codex.www.ads-software.com/Conditional_Tags#A_Single_Post_Page

    Thread Starter mmangar

    (@mmangar)

    Thank you for your reply alchymyth

    Here is the link to my header.php code: https://wordpress.pastebin.com/uHFTBMvX

    between these lines (line 112 appr.) in header.php,

    <!-- // Header -->
    
                            <!-- Content // -->

    insert the code for the banner (like ryan has done):

    <!-- 728x90 Advert -->
    			<div class="clear"></div>
    			<div class="advert-728">
    
    			<!-- your adsense code here -->	
    
    			</div>
    			<div class="clear"></div>

    the styles

    /* 728 x 90 Advert */
    
    	.advert-728 {width:728px;height:90px;margin:auto;margin-bottom:25px;}

    might already be in the theme, if not, add it at the end of style.css

    good luck ??

    Thread Starter mmangar

    (@mmangar)

    Thank you ver much the code works perfectly, I’m just having trouble using the single post conditional tag. Can you please show me where to place the tag.

    forgot about that ??

    <!-- // Header -->
    
    <?php if(is_single()) : ?>
    <!-- 728x90 Advert -->
    			<div class="clear"></div>
    			<div class="advert-728">
    
    			<!-- your adsense code here -->	
    
    			</div>
    			<div class="clear"></div>
    <?php endif; ?>
    
    <!-- Content // -->
    Thread Starter mmangar

    (@mmangar)

    Thank you for all your help, everything looks great.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Need Help With Custom Banner Placement’ is closed to new replies.