If you don’t know this theme yet, you should check it out at Graph Paper Press.
Modularity Lite is Thad Allender’s freebie version of a larger framework. I was customising this theme for Jerry Hyde’s site recently, and thought I’d take some notes to share with you.
UPDATE January 2011: This article gained a lot of attention since it came out in January 2010. Code changes dramatically with each release, which is why I’ve written an updated version for Modularity Lite 1.3. This article is about version 1.2. Tweaks may NOT work in later versions.
How to add your own Background Image
The background image gets loaded via the style.css file in the following line of code:
/************************* GLOBAL STYLES ***************************/ body {color:#eee;background: #111 url(images/bg.jpg) no-repeat center fixed;}
The full path to the default background image is wp-content/themes/modularity-lite/images/bg.jpg. Change it to your heart’s contempt!
How to add your own Logo or Header
have a look at the header.php file and find the following section:
<!-- Begin Masthead -->
<div id="masthead">
<h4><a href="<?php echo get_settings('home'); ? rel="nofollow">/" title="Home"><?php bloginfo('name'); ?></a> <span><?php bloginfo('description'); ?></span></h4>
</div>
Delete the <h4> and <span> tags and replace them with a link to your logo like this:
<div id="masthead">
<img src="http://yourdomain.com/yourlogo.jpg">
</div>
If you’d like that logo to link to your home page, wrap it in a link like this:
<div id="masthead">
<a href="<?php echo get_settings('home'); ? rel="nofollow">/" title="Home">
<img src="http://yourdomain.com/yourlogo.jpg">
</a>
</div>
Image Sizes
If you’re hosting images in places other than your website (say Flickr) you may find that those images are too big for your layout. Rather than fiddle with that, let’s have imgaes automatically resize when they’re wider than your theme.
Have a look at the style.css file and find the /* Floats & Images */ section, under which you’ll find these three declarations:
img.centered...
img.alignright...
img.alignleft...
The last value on each line ends with
max-width:950px
Change that to a smaller value and your images will be resized automatically. You may also want to add
heigh:auto
to each line so your images don’t get squashed. I don’t know which image alignment you’re using when you embed an image, so for safe measure, amend all three of them. As an example, here’s the first line of code in its entirety changed to 500px width:
img.centered{display: block;margin-left: auto;margin-right: auto;max-width:500px; height: auto;}
Slowing Down the Slideshow
The slideshow is generated in Java Script. Have a look in your functions.php file and look for a code block under the heading // Load Dom Ready Javascripts – it looks like this:
jQuery("#slideshow").cycle({ speed: '2500', timeout: '500', pause: 1
In it, you’ll find two parameters:
- SPEED which is in fact the cross fade duration,
- and TIMEOUT which is the duration of each slide.
1000 is about 1 second, 2000 is 2 seconds, and so forth. Play with those and see what happens. If you’d like cuts instead of corss fades, change the SPEED parameter to 1. The PAUSE parameter doesn’t seem to do anything so leave it alone.
Thank you so much, Jay! Amazing.
Hi Jay…..Got alot of ideas going through your site. Thanx for that. If you are free I would like to ask you something about modularity lite theme. I want to change the post and pages text color to black by putting the text box white. I couldn't find any way in css to modify that. If there is any way please suggest me.
Hoping your reply
Nitin
Hi Nitin,
I’m afraid there’s no easy way to do this because you’ll have to style several tags which kind of rely on each other to give you a cohesive look (which by default is dark). I can get you started though. Have a look at the style.css file.
First let’s disable the background image and repeater image for now by adding an “x” to the end of the file names like below. Then we’ll change the background colour values (set to #111 by default) to #eee or for white, and change the text colours (i.e. all <h-> and <p> tags etc) to #111 (they’re set to #eee by default).
You’ll end up with this:
/************************* GLOBAL STYLES ***************************/
body {color:#eee;background: #eee url(images/bg.jpgx) no-repeat center fixed;}
.container-inner {width:950px; margin:0 auto;padding:1.75em 0 1em}
.container {background:url(images/repeater.pngx) repeat;}
h1,h2,h3,h4,h5,h6 {color:#111;}
h1 a,h2 a,h3 a,h4 a,h5 a,h6 a {color:#111;}
h3.sub,h2.sub {margin: 0 0 10px 0;padding: 0 0 5px 0;font-size: 1.1em;font-weight: bold;line-height: 1em;text-transform: uppercase;letter-spacing: 2px;color: #515151;border-bottom: 1px solid #000;}
a {color:#428ce7;text-decoration:none;}
a:hover, a:focus {color:#fff;}
p {color:#111;}
h6.top {color:#ccc;}
#top {width:950px; margin:0 auto 1em;padding: 0 0 .5em; color:#666}
#top a {color:#666}
.login {float:left;}
/* Masthead */
#masthead { float: left;height:36px}
#masthead h4, #masthead span { margin: 0; padding:10px 0 0; line-height:2em }
#masthead h4 { font-weight: bold; text-transform: uppercase; float: left}
#masthead h4 a { color: #111; text-decoration: none; }
#masthead span.description { color: #111; text-transform: lowercase; font-size: .7em; padding: .35em 3em;}
.double-border {background: url(images/double-border.png) repeat-x bottom; height:8px; width:100%;clear:both;float:none;border:none;;margin:1em 0}
Now you’ll have to do the same with all your links, comment boxes and the footer… See where there’s a dark hex value and replace it with a lighter one, and vice versa.
Have fun 😉
Going to try this…Thanks a lot for your concern. Thank you again
How do I add my own logo to the modularity lite theme???