Social Web Directory :: Social Network Directory :: Ning Tips and Ning Support
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.
Tags:
Good Lord. This is brilliant. I use scripts to do this sort of thing, and here I'm supposed to be the CSS person. Alex, I am blown away with the simplistic yet genius thought process behind this. Now, I want to adopt you and Elson.
SUPERB thinking!
Jen
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?
Thank you so much jen and Alex, you are the best!
For example, in the ad box: xg_ad_above_header
Hi Emmanuel,
The #xg_ad_above_header will not work with CSS due to hierarchy of CSS ID/Class identifiers. It falls above the .xg_widget_main. This one would need script, and is available in the VIP Club.
The #xg_ad_below_header will work with CSS, because it falls below .xg_widget_main.
.xg_widget_main .xj_ad_below_header {display:none!important;}
Best,
Jen
Thank you very much Jen and Alex, you have saved my life :)
and now I am part of the VIP members! :)
Welcome to VIP CLUB!!
Welcome to
JenSocial: Social Web Directory and Ning Tips
Posted by JenSocial on May 7, 2018 at 8:35pm 9 Comments 1 Favorite
Posted by JenSocial on January 6, 2017 at 4:00pm 10 Comments 1 Favorite
Posted by JenSocial on October 22, 2016 at 1:05am 0 Comments 0 Favorites
Posted by JenSocial on September 17, 2016 at 12:00am 26 Comments 1 Favorite
Posted by JenSocial on August 31, 2016 at 3:30pm 13 Comments 0 Favorites
Ning 3.0 Tip - Add Buttons/Links Below Status Update (Quick Links to Add Photos, Posts, Discussions)
Started by Themes - Rosas Negras Mar 20, 2021. 0 Replies 0 Favorites
Started by JenSocial. Last reply by Kos Dec 6, 2016. 64 Replies 4 Favorites
Started by JenSocial. Last reply by JenSocial Jul 26, 2016. 41 Replies 1 Favorite
© 2024 Created by JenSocial. Powered by
© Copyright JenSocial.