Oracle of ONE1

Obscure words of unity

Archive for the ‘wordpress’


Posts not Pages

I have noticed that many novice WordPress users try to build their site using Pages. This fights the WordPress system. These users are not using WordPress as a blogging platform but as an entry-level Content Management System. Now I know we use words such as ‘view a web page’ but page here has a different meaning.

One thing I push, is that 99% of the site’s content should be in posts. Write content to posts. They are much more flexible and easier for a developer to work with.

Pages have their place on a site but are limited to non-hierarchical, never-changing, organizational metadata (information about data). So what goes on a page? About, contact, history, jurisdiction, terms of use, privacy statements, and a sitemap. All the boring stuff.

Posts, on the other hand, can belong to multiple categories and have unlimited tags. Categories and tags automatically create the navigational structure of the site. The power of going with the flow is that most of the structure is done for you instead of needing to be created by you.

Categories Sub-menu

This is a very simple version of a Categories sub-menu implemented in the sidebar.php. Once a category is clicked, the sidebar should show the following:

  1. Category description (this is useful other than the sidebar)
  2. Children categories
  3. Posts in the category

(more…)

Sidebar Display on Every View

The default template shows the sidebar only on selected pages. I often make a design decision to display the sidebar on every or nearly every page. This is a fairly straightforward set of template edits. As an example, we will work with the template single.php. This is the template which displays individual posts

To gain further understanding of which template files are used when view a WordPress site visit WordPress Site Architecture.

(more…)

Special Home Page

The Home page of your site is the entryway for many visitors. By default, WordPress shows nothing but your most recent posts. Alternatively, WordPress makes it easy to set a page as your Home. I find that neither of these are sufficient and take another approach. If your templates contain a file named home.php then that template file will be used instead of the default WordPress options.

(more…)

Header Navigation

The header is the identifying masthead of your website. It is often convenient to include top level or special navigation here. In fact, I usually modify the header to include navigation to these pages:

  1. Home
  2. About
  3. Contact
  4. Site Map (activate the sitemap plugin and include
    <!-- ddsitemapgen --> in your page or post)
  5. Store

(more…)

Categories in Sidebar Display

There a many reasons why you might not want all categories to display in the side bar. Some possible reasons are:

  • Display some categories under 1 title and other categories under another title
  • Some categories may serve a special purpose
  • Some categories may meant to be hidden

(more…)

Any HTML in the Sidebar

Use the Text Widget to add HTML to the sidebar. This makes it very easy to add a wide variety of features to your site. I will demonstrate a few simple examples.

(more…)

Multiple Recipient cform

cformsII is the flexible form plugin provided on dVector.com. A multiple recipient form takes one of two types.

  1. Each form submission goes to multiple recipients
  2. The recipient of a form depends on a form select box

(more…)

Regular Expressions in cformsII

dVector.com provides the plugin cformsII for forms. This is a powerful and flexible plugin. In advanced verification of visitor submitted data, regular expressions are often used. See cformsII help especially the ‘Using regular expressions with form fields’.

(more…)

Embed YouTube Video

Below is an embedded video from YouTube. I use the Smart Youtube plugin to accomplish this easily. Once this plugin is installed, it is a simple matter to embed the video. Simply copy and paste the YouTube link then change the http to httpv.

Prevent Stripped Attributes

By default, WordPress strips out the class and id attributes from all tags entered in a post. There are some security reasons for doing this so exercise caution before over-riding this behavior.

What is the Need?

You might ask why would I need to have class or id attributes in my tags. Well, the answer is that for most users and for most of your posts you do not need the attributes. There are, however; some circumstances where these provide additional layout options.

As an example; one of my clients wanted quotes from newspapers to have a special newspaper-like background. In standard HTML/CSS, this is relatively easy to do using <div id=”newspaper”></div> in your HTML and setting the style in your style sheet. This would work fine in WordPress, except for the fact that the id attribute will be stripped out when saving the post.

(more…)

Don’t Fight the System

This article introduces experienced and novice web designers to WordPress. WordPress has its own way of structuring data and it is much easier to adjust yourself to the natural structure of WordPress than it is to twist WordPress to your way of thinking. Adjusting yourself will make WordPress a surprisingly effective and efficient means of fulfilling your needs.

WordPress has extensive documentation that covers all aspects of creating, populating, and maintaining your blog or website. Please do view that documentation as it is always the most complete and current.

Don’t start your design with presentation, start with the structure and come back to the presentation later. First, make certain that everything you wish to do can be done by WordPress. WordPress is an advanced blogging system but it is not a Content Management System. A CMS offers far more flexibility to build the structure but it pays with added complexity.
(more…)