|
#1

Jan 25, 2013, 12:43 PM
|
|
|
367 posts · Oct 2012
Florida
|
|
How Do I Change This? How Did You Do That?
Quite often, people will ask "how to I change ___ on my site?" Other times, see something posted, such as a link in the "showing off" thread, and ask, "how did you do that?" One of the best ways to learn how to do things with wp and mz is to install a firebug plugin into your browser, right click the area of the page you want to know more about or change, and inspect the element.
In firebug, the html will be on the left, and the css will be on the right. What you won't see is the php that made the html, but most of the time you either won't need it, or it will be obvious from the default templates.
Last edited by jerryc; Mar 3, 2013 at 09:07 PM.
|
#2

Jan 25, 2013, 04:07 PM
|
|
|
367 posts · Oct 2012
Florida
|
|
Lazyest Stylesheet Plugin
Lazyest Stylesheet Plugin
Not everybody will agree with me on this, but I find the Lazyest Stylesheet Plugin to be the easiest way to add custom CSS to Montezuma. I have even requested that MZ add such a feature to its next release.
Here's how it works: - Install and open the plugin,
- Enter your custom CSS into it and save,
- Load your page,
- It always loads as the last stylesheet,
- If there's a conflict with it and something else, because it's last, your custom CSS wins the cascade order.
What I especially like about it is: - No need to ever touch the theme CSS files,
- All the custom CSS is in one place, easy to find, easy to validate.
It also has an optional mobile stylesheet, if you want custom styles on mobile devices.
Update: Juggledad also came up with a solution that also puts all the custom css in one place. Add it to the end of the last theme CSS file, clearfix.css.
Last edited by jerryc; Apr 15, 2013 at 06:18 AM.
|
#3

Jan 25, 2013, 04:50 PM
|
|
|
367 posts · Oct 2012
Florida
|
|
Code Validation
The problem with many coding mistakes is that, while the browser will display the page, it looks awful, and you don't know why. Many coding problems can be easily found by simple code validation.
Here's an example. you went into your code to change your layout and, while you were at it, changed an <h3> to an <h2>, but forgot to change the closing heading tag from </h3> to </h2>. When you try your page, your layout looks weird. You spend hours trying to figure out what you did wrong with your layout, when there was nothing wrong with the layout at all. It was the previous heading tag mismatch error that threw everything else off. And, who hasn't left out or put in an extra closing </div> tag somewhere.
HTML Validator
A properly coded MZ page should get no HTML errors. If you get errors, it's probably because you added something incorrectly, or you have plugins causing errors. Disable your plugins if you're not sure.
CSS Validator
If your custom code is right, you should get zero CSS errors; MZ is CSS standards compliant. If you use the Lazyest Stylesheet, it's easy to copy and paste your custom code into the validator because all your custom CSS is in one place.
PHP
Validating PHP is a more complicated. With some errors, your server will throw an error and the page will not display. With other errors, PHP will generate different HTML than you intended, which you might be able to spot with view-source.
Layout
Not all layout mistakes will show on a validator. For example, if your MZ column units in a row don't add up to 12, it won't show on a validator. Your page may just look strange. Here's how you can check your layout.
Last edited by jerryc; Feb 26, 2013 at 08:10 PM.
|
#4

Jan 25, 2013, 06:21 PM
|
|
|
367 posts · Oct 2012
Florida
|
|
Sidebars Anywhere
Sidebars Anywhere
With Montezuma, think outside of the 'side' when you hear the term sidebar. They can go in any template or subtemplate, such as in your header, footer, or even in the content area of a template. This gives you lots of layout options.
Once you declare a sidebar using code such as:
HTML Code:
<?php dynamic_sidebar("your-new-sidebar-name"); ?>
and save your template or subtemplate, the widget of named "your-new-sidebar-name" will automatically in your widgets interface at:
Dashboard > Appearance > Widgets
Here's an example of a sidebars by Juggledad that shows how to put a sidebar in the left side.
Last edited by jerryc; Mar 30, 2013 at 01:11 PM.
Reason: Added link to Juggledad's post
|
#5

Feb 26, 2013, 03:37 PM
|
|
|
367 posts · Oct 2012
Florida
|
|
Keeping All Custom CSS Together
In addition to my favorite way of keeping all custom CSS together, Juggledad has come up with another way to accomplish this, and his idea requires no additional plugins.
Go to: Dashboard > Appearance > MZ Options > CSS Files > clearfix.css
Put all your custom CSS at the end of that file. There is no need to edit any other CSS file. All other things being equal, any conflicts between conflicting declarations will be resolved in favor of the later declaration, and clearfix.css is loaded after all the other css files.
|
#6

Mar 3, 2013, 09:06 PM
|
|
|
367 posts · Oct 2012
Florida
|
|
I Don't Know Any ____! [HTML, CSS, PHP]
Occasionally, people post onto this forum wanting to customize Montezuma, knowing little or no HTML, CSS, or PHP. Montezuma is, by far, the most customizable theme there is for Wordpress. However, it still requires some basic understanding of HTML, CSS, and sometimes PHP. At the very least, you have to know how to format the code, so you can copy, paste, and edit it to make the changes you want to make. With that you can do amazing things with Montezuma. With other themes, you would have to know far more to do far less customization.
There are many great basic tutorials on these three languages. HTML is the basic one. CSS is how HTML is styled. PHP is how HTML is generated programically.
|
#7

Mar 5, 2013, 11:22 AM
|
|
|
367 posts · Oct 2012
Florida
|
|
Disable Those Plugins First
There have been so many posts on this forum where it turned out that the problem wasn't MZ related at all, but caused by a plugin. Sometimes, the moderator even asks the poster early on to disable the plugins and check, then, after many more posts back and forth looking elsewhere, the poster recognized it was a plugin problem, not a MZ problem.
When I first posted about code validation, I stated you could expect to see lots of validation errors. That's because I had plugins making them and I thought all those errors were normal.
Then, when I removed all the plugins and checked, WP and MZ made zero validation errors. When things don't validate, it can throw off a lot of other things, particularly with a theme like MZ that relies so much on CSS.
|
|