Category: Wordpress

Client Showcase: Dan Bennett Real Estate

Dan Bennett Real Estate is a full service real estate agency located in the North Shore of Massachusetts. Dan Bennett has been a client of MDS for 5 years now and we’ve thoroughly enjoyed working with him and bringing his business to the internet world. Dan is a very well known man in his community, having done lots of charity work, sits on the board of Trustees, the local school boards, as well as the town of Selectmen. He is a trusted notary, realtor and a family man. Continue Reading..

Still Thinking Local First

So remember in 2011 when we posted about Dane Buy Local? Well last year was a tight year for MDS and we had to cut costs in all corners, sadly we had to cut our membership out.  We made a promise that when the time was right we would re-join.  That time has come and we are excited to announce that we are now back as members. Continue Reading..

The CSS !important Specifier

One of the challenges people new to Cascading Style Sheets face is figuring out why the rule they just coded doesn’t seem to be doing anything. Once you start building more complex websites, it’s likely that several rules will apply to a single HTML tag. In some cases, all of the styles can be applied; for example, you could say that everything in your content area will be colored green, then say that your paragraphs will have size 12 font, and you’ll end up with green, size 12 text. But what happens when styles contradict?

As it happens, you can (mostly) figure out which style will take precedence by doing a little math. If you’ve used an inline style applied directly to the element in question, it has weight 1000 (and almost certainly wins). Otherwise, add up 100 for each ID in the style, 10 for each class, and 1 for each element. Psuedo-classes (such as :hover) cound the same as real classes, as do attribute selectors (such as [type=”submit”]) Psuedo-elements (such as :first-letter count the same as real elements. Highest number wins!

In case of a tie, whichever specifier is encountered last is considered to be more important. This applies to both internal and external styles, so if you import several external style sheets, whichever one is important last will win all ties.

So what do you do if your new style doesn’t seem to be working? Well, from a practical standpoint, the first thing to do is make sure you haven’t mistyped anything, maybe mistyped a class name or used a . where you need a #. After that, the best thing to do is to make your selector more specific – that is, add more IDs and classes to give it greater weight –  so that it will override the less specific selectors.

However, if you have a style that absolutely MUST apply in all situations, you can use the !important selector.  (Does anybody else read that as saying “not important”?) This selector applies only to one particular property, not the entire block. For example, suppose I have this code:

#container {
color: black !important;
font-family: ‘Cambria’, ‘Times New Roman’;
}

#content {
color: red;
font-family:Arial, Helvetica, sans-serif;
}

Any text that is inside the content box, which is inside the container, will be in Arial…but it will be black.

The !important statement should be used only sparingly; not only do you not want two !important statements to ever apply to the same line of code, but it’s a real pain to have your selector not working because there’s an !important line somewhere in your external style sheets!

WordPress: Themes and Child Themes

A WordPress theme is what defines the look and feel of a site; while the WordPress CMS provides most of the functionality, the theme makes the site look good. So what is a WordPress theme anyway?

A theme is simply a collection of .php and .css files that tell WordPress what content to display and how to display it. There are a huge number of themes available for free; any theme available to download from within WordPress is required to be licensed under the GPL, so you can do whatever you want with it. There are also a number of premium (read: $$$) themes available, ranging from fairly cheap to hundreds of dollars, that provide more options and more optimized code than the standard free themes.

When coding your own theme, you have several options. One is to start coding from scratch. As you can imagine, this is the least popular and least efficient option.

Another is to take an existing theme and modify it to get what you want. The advantage is that the theme is already in working order, and all you have to do is make the changes you need. The disadvantage is that if the theme is updated and you want the updated version, you have to go through and make all of the changes again! Additionally, if you modified a GPL theme, then you are legally required to release your modifications under the GPL as well.

Probably the most popular option is to build a child theme. In this case, you still start with an existing theme, but rather than modifying it directly, you make your own files that tell WordPress what to change. The nice thing is, the base theme can be updated without affecting your child theme files; additionally, you can build a premium theme on top of a GPL theme. Thus, this is the preferred option for both flexibility and ease of use, and a number of premium themes exist that are child themes of other (free or premium) WordPress themes.

Google Adsense and Smart Pricing

You may have noticed that we don’t run advertisements on this blog. The main reason for that is that we don’t think it looks professional on a business website; also, we don’t want you to click an ad and go elsewhere. We want you to stay here and hire us!

That said, we do own other websites which are monetized with adsense and make about a buck fifty per click. This brings us to another reason we wouldn’t want to put adsense on this blog: it could drag down what we’re making elsewhere! Why? The answer lies in Google’s “smart pricing” policy.

Google wants to  make sure that their advertisers are getting good value for their money, so that they’ll keep spending; this means not putting high-cost advertisements where they’ll receive low-quality traffic. Social media traffic, for example, tends to not click on ads and not buy when they do, so a blog that gets a lot of social media traffic compared to search engine traffic will get paid less per click. Similarly, Google hates Made for Adsense (MFA) sites, which have no content whatsoever, just a bunch of ads; the hope is you’ll click on one of these spam sites and immediately leave via one of the ads. Whereas a legitimate site like this one tries to provide useful information – we want you to find what you were looking for even if you don’t hire us – a spam site just wants you to click an ad and doesn’t want anything getting in the way of that, including content.

However, bad or no content isn’t the only way to get smart priced; as mentioned, the type of traffic your site receives matters as well. This site would do poorly with adsense because we discuss topics like blogging and web design. It’s not that Google dislikes these topics; it’s just that people who want to read about them generally don’t make money for the advertisers, so Google isn’t willing to pay much for that traffic.

A little bit of money is better than no money, right? The thing is, Google doesn’t smart price websites; they smart price adsense accounts. If I was to place adsense on this site and Google decided to smart price us, the pay rate on my other sites would go down as well, which means that having the advertisements here would actually be costing me money! Fortunately, if you get caught in that trap, there’s a way out: just remove the adsense code from the offending site and your remaining sites should return to normal.

WordPress and .htaccess

Having installed a number of WordPress blogs lately, one thing I frequently find myself doing after a new installation is editing the .htaccess file. What is .htaccess all about?

On an Apache server, .htaccess files allow you to make configuration changes to a directory (and its subdirectories); multiple .htaccess files can be present in your directory structure, with lower ones overriding higher rules where they conflict. They’re often used for access control, helping to keep the wrong people from poking around in your files. Today we’ll talk specifically about how they interact with WordPress.

Aside from the basic WordPress functions, I’ve mostly used the .htaccess file to force my webhost to use the correct version of PHP. My preferred host offers both PHP4 and PHP5, but defaults to PHP4; this tends to cause issues with WordPress plugins. The solution? Just add the following line to the .htaccess file in your WordPress directory (or a higher directory):

AddType x-mapp-php5 .php

This tells Apache to use PHP5 when interpreting a .php file, and all is well.  Of course, this assumes that your host actually has PHP5 installed; given that it’s been out since 2004, if your host doesn’t support it, it’s probably time to find a new host.

What else can we do with the .htaccess file? WordPress uses it to store the rewrite rules for permalinks. Be careful editing the .htaccess file that WordPress uses; if you put your code in the wrong place, it will be overwritten next time WordPress updates the file. I often prefer to simply go up a directory, where feasible.

Often the default amount of memory allocated for PHP is insufficient; you can increase it with the following line:

php_value memory_limit 64M

The above line is hopefully fairly self-explanatory;  other attributes you can set include upload_max_filesize and post_max_size, which often default to 2M each.

Host a site with a lot of photos? Find people stealing your bandwidth? Try this code:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+.)?mysite.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpg [L]

Obviously, replace “mysite” with your own URL and “/images/nohotlink.jpg” with the image you want to display on the site that’s attempting to display your image. (Thanks to WPRecipies for this tip) You may want to host the second image on a different server to avoid the possibility that your host will get into an infinite loop.

Next time: using .htaccess to prevent spam.

Terminology for Internet Marketing

As with any technical field, online advertising has its own terminology and set of TLA (three letter acronyms). Today let’s review some of the more important ones.

CPA: Cost Per Action. In this case, you get paid (or pay someone) when the user takes a predefined action, such as signing up for a credit card.

CPC: Cost Per Click. Self explanatory. This is the model under which Google Adsense generally operates.

CPM: Cost Per Thousand (page views). M is the roman numeral for 1000.

CTR: Click-Through Rate: how often do people click on your ads?

PFP: Pay For Performance; you get paid if your advertising is successful. See also CPA/PPL/PPS.

PPC: Pay Per Click

PPL/PPS: Pay Per Lead/Sale

PV: Page View

SEO: Search Engine Optimization; this is the process of getting your website to rank highly in search engines, particularly Google. A similar term is SEM, Search Engine Marketing, which also includes paid advertising.

Website Usability, Part V: Don’t Annoy the User

It seems obvious, but many sites seem to have a problem with it: if you want your users to keep coming back, don’t annoy them! Here are a few common-sense things to avoid.

  • No unsolicited windows. If you use pop-ups on your site, half your users will be using a modern browser that blocks them, and you’ll annoy the rest. Find a better way to get attention.
  • Arrange the website logically. Don’t make the user think about how to find something; it should be obvious.
  • Provide a search; we mentioned this before, but it bears repeating. Today’s users don’t want to click around looking for things; they want to jump straight to their target.
  • Be consistent. Again, this is something we mentioned before. If your navigation bar is on the left on your homepage, it should be on the left on every other page as well. A user attempting to search should know exactly where the search box is without having to, well, search for it!
  • Don’t make the user do work that the computer can do; one particularly annoying example is when the same information must be input in several places.
  • Avoid making the user remember things. If two or more items must be compared, place them side by side.
  • Design efficient pages. Even if you expect most users to be on broadband, remember that large images still take time to load, and a bored user is a lost user!
  • Don’t make users lose their work! If a page must time out, warn the user and give him a chance to extend the timer or save his work.
  • Design webpages so that they can be printed; long, complex documents in particular are often printed for later reading. If needed, the page can use different style sheets for viewing and printing.
  • When users must wait for something to complete, give them a way to track progress; for particularly long tasks, such as large downloads, provide an estimate of how long the task will take.

Website Usability, Part IV: Arranging Page Elements

One aspect of designing an effective webpage is to make it easy for users to find what they’re looking for. Overly cluttered pages, for example, tend to confuse users.

Users anticipate where things will be; don’t surprise them! Users expect that important items (such as the navigation bar, as we discussed in part 2) will be in the same place on every page, near the top. Never put important items “below the fold”! Users should never need to scroll to find navigational items, such as search boxes.

 

Eye-tracking studies have shown that users first look at the top of a page, then at the left side, then the right side; this is why those have been popular locations for banner ads. Important information should be placed in these areas so that users are sure to see it, while less important information should be placed lower down on the page; this helps users to process it more easily.

One thing that makes scanning a webpage for information difficult is when it is too densely packed; not only do users have an easier time searching spare areas of the page, they tend to visit those areas quickly. Lesson: don’t cram important information into too small a space! On the other hand, too much whitespace wastes time by causing users to scroll unnecessarily; effectively using whitespace allows you to place plenty of information on the page without it feeling cramped.

When possible, it’s best to use a fluid page layout so as to utilize the user’s entire screen; designing for a particular screen size inevitably means the page will display improperly for most users. However, be sure that items are aligned consistently, as this makes them easier to scan.

The proper length of both the webpage and the lines displayed on that page depends on what type of content is being displayed. Longer pages are appropriate for uninterrupted reading, while homepages, navigation pages, and those that need to be browsed quickly should be shorter. Users prefer shorter line lengths, but read faster when longer line lengths are used, so the choice is a trade-off between user preference and usability.

Website Usability, Part III: Text

One website that I tend to avoid if at all possible is MySpace; too much of it seems to be pages composed with horribly clashing colors, backgrounds that don’t contrast well with the text, and other things that make them difficult (and annoying) to read. I would go so far as to call the typical MySpace page an excellent lesson in what not to do. What can we learn from them?

 

Formating your text

If you want people to to read your site (rather than hitting the back button), make it easy for them. Use 12-point (or higher) resizable text, preferably dark text on a light background. Choose one font, preferably a standard one such as Times New Roman or Arial, and stick with it. Typing in all-caps has been considered annoying since the earliest days of the Internet; use appropriate capitalization!

Be consistent

As mentioned, you should choose one font to use for the entire site; common page elements should also be consistent. Navigation bars, for example, should be in the same location on every page.

Attracting Attention

A number of elements are designed for attracting attention; use them sparingly. For example, this page uses bold headers to let the reader know what each paragraph will be about; randomly bolding words throughout the document would only lead to confusion! Animation in particular should be used sparingly;  it should convey useful information that the reader needs to know immediately, or users will simply find it annoying. Additionally, use emphasis (bold, italics, etc) only on short phrases, and never use underlines for emphasis as users are programmed to regard underlined text as links.

Remember: making it easy to quickly scan webpages for important information makes them more useful to the user; avoid using attributes that can be distracting or make the page difficult to read. Strive for simplicity in design; don’t change how information is being presented simply for the sake of variety.