• Hi everyone.

    I need to show ads in my sidebar on every page EXCEPT the home page. I thought I had figured it out using if(is_single() but discovered categories, pages, archives- and everything else was not displaying the ads in the sidebar.

    If anyone knows the exact code I should use it would be helpful.

    Below is what I am using

    <?php if(is_single() && $post==$posts[0] && !is_paged()) { ?>
    		CODE HERE
    <?php } ?>

    Thank you 🙂

Viewing 8 replies - 1 through 8 (of 8 total)
  • you can use this

    <?php if(!is_home()) { ?>
    CODE HERE
    <?php } ?>

    Thread Starter Bhoney

    (@bhoney)

    Thank you for your response.

    I actually didn’t know my post had gone through because I got an error message.

    Anyway- I used the above code and it worked. However, while browsing my site I discovered the ads are not showing on pages like below:

    http://mysite.com/page/2/ and so on.

    I am using the Paginate plugin.

    Is there anyway to make the ads show up on these pages as well?

    Thanks 🙂

    Conditional_Tags – everything is in the Documentation, just has to be read.

    Thread Starter Bhoney

    (@bhoney)

    I actually did read the Conditional Tags pages. Posting for help was a last resort after several things didn’t work. As I said above, via searching I actually found the info blogsdna gave me. I then read some more and came back and asked again after I could not figure it out.

    I know some are lazy and won’t read or search first before asking for help- I however, did both.

    🙂

    Read it again: 2.15.

    Thread Starter Bhoney

    (@bhoney)

    Do I have to alter this code above or do I have to add a whole new line of coding with the content I need to show on the paged page as well?

    I am not a coder, I just can read code, but yes, you have to ADD the “paged” thing. Actually, you had it in your first example, only saying “if it is NOT paged”. You need AND if it IS paged (remove the !)

    Thread Starter Bhoney

    (@bhoney)

    I figured there was a way to add it with the first set of coding but I couldn’t get it to work. I tried removing the ! and changing words around…. nothing I just ended up adding a whole new set of coding with the ad content I was trying to display.

    Just in case anyone else wants to know.

    Thanks 🙂
    ——————–
    <?php if(is_paged() && $post==$posts[0] && is_paged()) { ?>
    Content Here
    <?php } ?>

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How To Display Sidebar Content On All Pages Except The Home Page’ is closed to new replies.