How to style the Motion Theme for WordPress

by Jay Versluis on June 14, 2011

in Themes, WordPress

I had a closer look at this theme the other day when I made some upgrades on Nadia’s website.

I really like the look and feel of Motion but I felt certain things were missing from this wonderful theme, such as drop down submenus.

Let’s take a look at some tweaks and how you can make Motion your own.

This article was written for Version 1.1.6 – these tweaks may not work in later revisions of the theme.

Removing default Navigation

This version of Motion includes two areas for navigation menus: one called “Top” is at the very top of the screen, and another is called “Primary” just below the header.

Even without a custom menu active these two menus show some default values: the Top Nav shows pages whereas the Primary Nav shows categories. This can be annoying when you only want one of these navigations to be visible.

To remedy this, head over to Appearance – Menus. Create a new menu here (let’s call it Empty) then place nothing inside. Now select the Empty menu as your Primary Menu and your “no categories problem” is gone.

Primary Navigation and Drop Down Menus

One of the surprising things is that subpages and sub categories do not appear as drop down menus as you’d expect. Let’s make it happen!

The good news is that the CSS has built in support for drop downs on the Primary Menu – all we have to do is make the sub pages show up. Have a look at your header.php file and find this piece of code:

if (has_nav_menu('primary')) {
 wp_nav_menu( array(
 'theme_location' => 'primary',
 'depth' => '1',
 'menu_class' => 'primary_menu') );
 }

The depth parameter (1) tells WordPress not to display sub items in the menu. Let’s change that to 2 and drop down menus now work like a charm below the header!

Please note that this does not work for the Top Navigation menu (where it would be annoying – so let’s not go there).

Bigger Nav Menus

To increase the size of the top navigation, hunt around for this code block in style.css:

<code>#top .top_menu li a {
	color: #fff;
	font-size: .75em;
}</code>

Change the font-size element to 1.5em or similar. You can even add a line like font-weight: bold; to make the menu stand out.

To increase the size or the Primary Navigation (below the header) hunt around for this piece of code – same thing here, change the font-size value:

.primary_menu li a {
 display: block;
 margin: 0;
 font-size: 0.8em;
 color: #fff;
 padding: 0 13px;
}

Removing default Footer Widgets

The footer shows “default widgets” which are often designed to show how a theme would display widgets. They show up when you don’t use widgets – which can be annoying.

To get rid of those just add an empty Text Widget into each widgetised area at the bottom you’d like to leave empty.

Bigger Site Title

In style.css have a look for this block of code:

<code>#header #logo h1 a {
	color: #fff;
	font-size: 2em;
	font-weight: normal;
	text-shadow: 0 0 6px #555;
}</code>

Here you can change the font-size element to say 3em, that’ll be big – play around with it and see what suits you. The colour of the site title is changed by replacing the #fff with your preferred value. If you’d also like to change the hover colour look to this piece of code:

#header #logo h1 a:hover {
 color: #a8ef9d;
}

Amending the Welcome Box

The Welcome Box is the piece of text next to the Site Title, the one that reads “Hey there, thanks for dropping by…”. You may want to provide your own text here, perhaps an author picture even, or you just want to get rid of it.

The code for this is in header.php and looks like this:

&lt;div id="headerbanner"&gt;
 &lt;p&gt;Hey there! Thanks for dropping by &lt;?php bloginfo( 'name' ); ?&gt;! Take a look around and grab the &lt;a href="&lt;?php bloginfo( 'rss2_url' ); ?&gt;"&gt;RSS feed&lt;/a&gt; to stay updated. See you around!&lt;/p&gt;
 &lt;/div&gt;

Amend as you like, comment out or delete from opening to closing div tag. Alternatively, if you’re building a Child Theme and you don’t want to redefine the entire header file, you can add this piece of CSS to your style sheet to suppress the message:

#headerbanner {
display: none;
}

Removing the Search Box

Even though the Search Box at the top of the screen is a nice touch, it can get in the way if you’re going for a much simpler look. We decided it would be better off in the sidebar as a standard widget.

In header.php you’ll find this call to to PHP script – simply delete or comment it out:

&lt;?php get_search_form(); ?&gt;

Footer Copyright

If you’d like to change the copyright message at the bottom of the page, take a look at the footer.php file and find this piece of code:

&lt;div id="credits"&gt;
 &lt;div id="creditsleft"&gt;Powered by &lt;a href="http://wordpress.org/extend/themes/" rel="generator"&gt;WordPress&lt;/a&gt; &amp;amp; &lt;a href="http://www.webdesigncompany.net"&gt;Web Design Company&lt;/a&gt;&lt;/div&gt;
 &lt;div id="creditsright"&gt;&lt;a href="#top"&gt;&amp;#91; Back to top &amp;#93;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;

Amend this as you like – but please keep in mind that credits should be where credit is due. You’re already getting a free theme, why not link to the people who’ve given it to you.

How to remove Page Titles on full screen pages

Sadly Motion does not target the page titles via CSS so we can’t easily suppress them them. When you display a page without a sidebar you’ll still be left with a smallish page title as opposed to one that has the translucent border. If you want to get rid of this take a look at your page.php file and find the following block of code:

<?php if (!(the_title() == "")){ ?>
<divclass="posttop">
<h2><?php the_title(); ?></h2>
</div>
<?php } ?>

Delete the entire thing and your page titles will be gone. This will not affect pages with the sidebar, as these are targeted by a different fie.

That’s all folks – best of luck and Happy Hacking ;-)

Further Reading

{ 65 comments… read them below or add one }

william meara June 15, 2011 at 12:33 am

Hi mister guru, firstly i would like to say thank you for going through the trouble of writing this up, i’ve bookmarked at and have decided to use it as my holy bible for my site as I use the motion 1.1.6 theme. Only problem is, it may sound stupid but in my primary menu, the one that is set by your catagories, when clicked on, the pages have too many posts on them. is there anyway i can get these to just show small abstracts and then a ….Read More link? would be realy helpful in reducing the loading time for the page. thanks a million

william meara

Reply

Jay Versluis June 15, 2011 at 9:45 am

You’re very welcome, William!

There are two ways you can deal with this: if you want full control over where the break is happening, and if you only have a handful of articles on your site, edit each post and insert a <!–more–> tag. There’s a handy button next to the spell checker which does this for you, you’ll see a line where the page break is inserted. I reccommend this approach.

Alternatively, if you have a lot of articles on your site and you can’t go through every single one of them, edit your archives.php file and have a look for this line of code:

<?php the_content( 'View full article &raquo;' ); ?>

Replace the_content with the_excerpt and these breaks will happen automatically. The downside is that they only show text and no pictures you may have inserted.

Good luck ;-)

Reply

william meara June 15, 2011 at 11:41 am

wow, they dont call you the guru for nothing, ill be sure to give this a go. If it works, i might just throw ya a cuppa :D legend

Reply

Jay Versluis June 15, 2011 at 11:34 pm

Excellent, glad to hear it helped. In fact I was just reading your comment over a lovely cup of joe :-)

Reply

Derek June 28, 2011 at 12:36 am

Jay!

Thanks for the very helpful tutorial! I am currently editing this theme for a client’s site to customize it, and had one question: for some reason, I can’t get the Page Title to change size at all! This should be a simple fix, but it’s causing me some stress.

Here’s why:
========================

Testimonials
Blah, blah, blah…
========================

In this case, I want to change the size of the Page Title “Testimonials”. The page title’s CSS appears to be something dynamic (in this case referencing the page’s Permalink ID of 13). I thought I had traced it back to this CSS class correctly:

========================
.posttop h2.posttitle a {
color: #afdaff;
font-size: 1.2em;
}
.posttop h2.posttitle a:hover {
color: #a8ef9d;
border-bottom: 1px dashed #a8ef9d;
}
=============================

…however, that only controls a POST title. I want to change a PAGE title.

Any ideas, guru? I’d love your help on this, if you can spare a second. :D

Reply

Jay Versluis June 28, 2011 at 1:19 pm

Hi Derek,

sure thing – that’s a bizarre puzzle indeed. You’re absolutely right, it should work but it doesn’t. You’re using the default page template without the sidebar, correct? Because the one with the sidebar works just as we’d expect.

There are two parts to solving this puzzle. First, have a look at the page.php file (that’s the one without the sidebar). It looks very different from the page-with-sidebar.php file. Not only does the non-sidebar file not create a permalink in the title, it also has a title-empty query before it styles the headline… why is a mystery. Let’s take it out – I’m just adding PHP comment tags here:

<?php // if (!(the_title() == "")){ ?>
<div>
<h2><?php the_title(); ?></h2>
</div>
<?php // } ?>

That should style our headline just like the with-sidebar template – IF the headline would be a link. It’s not though, and it doesn’t need to be. Let’s amend the CSS so that the syling happens regardless of there being a link or not:

.posttop h2.posttitle a, .posttop h2.posttitle {
color: #afdaff;
font-size: 3.4em;
}

I’ve added .posttop h2.posttitle (without the a) to the handle so it works both ways. I’ve also increased the font-size to 3.4em to see if it has the desired effect.

Style away – and let me know if it works ;-)

Reply

Derek June 28, 2011 at 7:29 pm

Jay,

You are AWESOME! I screwed around for an hour with that yesterday and couldn’t get it to work! That totally did the trick. :D

Got another query for you: I have a home page which will show no posts (this is primarily a static site). I cut out all the post/comment related code in the home.php template file, and will replace it with custom CSS/graphics to meet the clients wishes.

Once that’s done, am I able to add “Home” as a menu item in the navigation bar at the top of the page? I’m aware that you can just click on the Site Title and it will take you there, but the “Home” nav option is another client request. Do I need to change anything in the “Reading” settings, as well?

Thanks so much for the help, Jay! :D

Reply

Jay Versluis June 28, 2011 at 9:39 pm

Thank you thank you, glad it worked!

Yes you can add a Home tab via the Wordpress Menu. Use a custom link, call it Home and make it point tomyour site’s URL (under Appearance – Menus)

Reply

Derek June 28, 2011 at 9:53 pm

Hmmm, followed your instructions to a T and it didn’t work…any other ideas?

Reply

Jay Versluis June 28, 2011 at 10:35 pm

For the menu to be active, you need to first create one, then activate it. Once that’s done you can add posts, pages, custom links and categories to the menu.

Motion has two menu areas, one at the top above the header, one below the header. Make sure you activate your menu where you’d like to see it.

Good luck!

Reply

Raj July 4, 2011 at 12:36 pm

I want to remove title from the pages(with sidebar and without sidebar). Can you please help me how to do that?

Thanks.

Reply

Jay Versluis July 8, 2011 at 8:33 am

Hi Raj,

you need to amend two files – page.php and page-with-sidebar.php. In each of them has this code in it:


<div class="posttop">
<h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
</div>

Remove it or comment it out – and your page headlines will be gone.

Reply

Derek July 4, 2011 at 6:51 pm

Jay! Just wanted to follow up with you and let you know that I got everything working just great! (Turns out I may have followed your directions to a lower-case “t” – my bad!) In the end, the client was super happy with how everything turned out, and I have you to thank, so…THANK YOU! :D

Reply

Jay Versluis July 5, 2011 at 9:22 am

Thank you Derek, what a nice thing to say :-)

May there be many more happy clients for you and me in the future!

Reply

William V. Burns September 26, 2011 at 11:49 am

Your instruction on how to enable drop-down submenus fixed my site!
Thanks!

…for saving me time and trouble and lost hair I bought you a cup o’ coffee.

Reply

Jay Versluis September 26, 2011 at 12:38 pm

Thank you William, that’s muich appreciated! I’ll have it this afternoon ;-)

Reply

Susan October 31, 2011 at 8:19 pm

Hello WP Guru. I have another modification I would like to do to Motion 1.1.6 that is not mentioned in this post and I was wondering if you could help. The side bar does not show up on each page. How do I get the sidebar to show up on all the pages?

Thanks in advance.

-NetSocialMOM

Reply

Jay Versluis November 2, 2011 at 2:28 pm

Hi Susan,

by default Motion shows the sidebar only on posts, not on pages. But there is a page template that does show the sidebar: while you’re editing a page, have a look at the right hand side – there’s a box called Page Attributes. In it you’ll see a drop-down menu for your Template. If this is set to Default then the sidebar won’t be show. Set this to Page with Sidebar, hit update and you’ve got the sidebar back.

Most themes do it the other way round. Templates only work on pages – posts don’t have a templates as such.

Hope this helps ;-)

Reply

Tim Clare November 3, 2011 at 6:57 am

Hi Jay,

I’m also using the motion theme, but i’m trying to hide the Page Title which is currently called “Home”. I would like it not to appear on the home page (and also have the option of switching it off on other pages if and when I need to).

Any help on the code to enter and which part of the theme code to edit?

Many thanks for any assistance.
Tim

Reply

Jay Versluis November 3, 2011 at 2:51 pm

Hi Tim,

I’m not entirely sure what you mean by the Home Template. If you mean the tab that says “home” above (and below) your page title then that’s done via Custom Menus. By default, Motion has both menus activated and fills it with categories (at the top) and pages (at the bottom).

To override this, head to Appearance – Menus and define two custom menus there. Select and activate them both, then populate them with elements you’d like to appear there.

I’m explaining more about Custom Menus in this screencast.

Hope this helps ;-)

Reply

Leave a Comment

Previous post:

Next post: