TIPS: Add ADs only in main page, profile pages or any other pages

Sometimes you may want ADs or special contents display in the main page, profile pages or any other pages only. It's easy to display contents only in main page. Because you could add a text box that only show in main page. But how to control contents only display in profile pages but not in main page and any other pages? And how to control contents display in every pages except the main page and profile pages? Actually it's very easy. You just need a little CSS. 

 

Here are the steps:

1. Add a text box for all pages.

2. Edit the text box in HTML mode, put all content/ad inside a div tag with a special unique id:

<div id="ad_sidebar01">
.... Your content or ad code here .... 
</div>

 

3. Go to the Advance CSS, add this CSS code if you don't want it display in the main page but any other pages:

.xg_widget_main #ad_sidebar01 {display:none;}

 

Or this CSS code if you don't want it display in all profile pages:

.xg_widget_profiles_profile #ad_sidebar01 {display:none;}

 

If you add both, the content will display in every pages except the main page and profile pages.

 

4. If you want it display in profile pages only, use this code:

#ad_sidebar01 {display:none;}
.xg_widget_profiles_profile #ad_sidebar01 {display:block;}

 

Remember to replace #ad_sidebar01 with yours.

 

 

 

This tips is tested with both Design Studio and old themes.

 

Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported.... Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at iYouMe.net.

Load Previous Replies
  • up

    Dr Husky (Emalejandro)

    This tip is awesome!!!! but.... it is for Sidebar only

    What about for the top box (or above ad-box)?

    I've tried everything without success. or where to find the solution?

    • up

      Dr Husky (Emalejandro)

      For example, in the ad box:  xg_ad_above_header

      • up

        willy

        hi all i need help how to do this i need put GOOGLE ADS INSIDE CONTENT LIKE BLOGS AND FORUM DISCUSSIONS

        1