Target Your Home Page - Add Body CSS Class Selector

If you want to target your Ning 3.0 Home Page, this tip should help you out. I haven't shared this yet, thinking that Ning would add a CSS Class Selector for the Body tag of the Home page. They have added classes to all pages but the home page, maybe just an oversight. As of this writing, Ning hasn't added a body class selector to the home page.

 

Instructions - Add Body Class Selector to Home Page:

  • To target your home page, even if you just want to add a unique background for the home page only, add the following code to your Custom Code Box - - bottom box called "End of Page Code" Box.
  • To access the box, go to: Toolbar / Social Site Manager / Custom Code / End of Page Code
  • Add the script below and Save.
<script type="text/javascript">
var xpathname = (window.location.pathname);
if (xpathname ==('/')) {
x$('body').addClass('home_page');
}
</script>

 

Example Usage - Add Home Page Body Background, using a Seamless Tile (Textured Paper)

  • Add the following CSS to your Advanced CSS (under Toolbar / Design Studio / Custom CSS).
  • Change the image URL to your image tile.
  • Paste into Custom CSS and Save.

 

body.home_page {
background: url("http://storage.ning.com/topology/rest/1.0/file/get/978223991?profile=original") no-repeat center center fixed!important;
}

 

 

 

Views: 430

Reply to This

Replies to This Discussion

Good idea! Thanks for sharing :)

Glad you like it. Was one of those deals, had to have it. =)

I hope you're doing well,

Jen

RSS

Members

© 2024   Created by JenSocial.   Powered by

Badges  |  Report an Issue  |  Terms of Service

Home
VIP Ning Tips