Results 1 to 2 of 2

Thread: Show ads on all non-sticky (featured ads) pages

  1. #1
    Thread Starter
    mlepisto's Avatar
    Join Date
    Oct 2009
    Location
    United States
    Posts
    15
    Thanks
    0
    Thanked 1 Time in 1 Post

    Show ads on all non-sticky (featured ads) pages

    Hi,

    Thought someone else might find this off use.

    I run ads just below the navigation bar and above the featured ads slider on my sites, but I didn't want to run ads on featured ads since I charge for them, and the other ads are free. (Free ads have advertising, featured ads don't) So far I've only done this for the top ads, but the principle for the sidebar is similar, unless you're running the ad code via a widget which makes things a bit more complicated.

    In header.php, at the bottom of the file, just below

    Code:
    </div>
    I added

    Code:
    <?php
    	$topads = 'true'; 
    	if(is_single())
    	{
    		global $wp_query;
    		$thePostID = $wp_query->post->ID;
    		if(is_sticky($thePostID))
    		{ $topads = 'false'; }
    	}
    	if ($topads == 'true') {
    ?>
    
    PUT YOUR HTML HERE
    
    <?php } ?>
    I'm sure there's a programmatically more elegant way to do it, but this works well enough for me.

  2. #2
    Newbie
    Not a Verified Customer
    Green's Avatar
    Join Date
    Jul 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Re: Show ads on all non-sticky (featured ads) pages

    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Empty Categories doesnt show up on Navigation bar.
    By shightouch in forum ClassiPress General Discussion
    Replies: 1
    Last Post: June 3rd, 2009, 02:46 PM