Archive for November, 2010

How to Create, Enable and Edit Menus in WordPress 3.0

WordPress 3.0 introduced a new menu feature. If you’ve downloaded your theme from WordPress Extend, it might not support the new menus yet, but here I’ll show you how to modify your theme to enable this feature.

Creating a Menu:

To get started with your custom menu, go to Menus under Appearance. Your first menu will be created for
you when you load this page. If your theme does not support this feature you will get this message

“The current theme does not natively support menus, but you can use the “Custom Menu” widget to add any menus you create here to the theme’s sidebar.”

Use the checkboxes on the right side of the page to add new items to your menu. You can add almost any kind of content as a menu item. By default, the menu management page shows pages, categories, and custom links to URLs you specify. However, you can turn on the boxes that will let you add posts, tags, custom content types, and custom taxonomies. You can add multiple items quickly by checking them all at once and pressing the Add to Menu button.
Be sure to press the blue Save Changes or Create Menu button before leaving this screen! Otherwise your menu changes will be lost.?

Enabling Menus:

Navigation menus are a big new feature in version 3.0. If you want to support them in your new theme, or if you’re modifying an older theme for 3.0, you’ll need to add the following  code to your theme files.

Enabling navigation menus
// in functions.php:
add_theme_support(‘nav-menus’);
// wherever your current menu tag is located, replace it with:
<?php wp_nav_menu( ‘sort_column=menu_order’ ); ?>

If you prefer, you can use the new Navigation Menu widget rather than placing the menu tag in your templates.

Creating Multiple Menus:

You can create more than one menu. Click the tab containing a plus sign, and you’ll see the menu creation screen. The second menu will become active, and you can begin adding items to it. You can switch back to the first menu using the tab above the drag-and-drop menu item area.

Editing Menu Items:

To edit an item’s details or delete it from the menu, use the arrow on the far right side of the item to show the detail editing box. By default, the menu item will display the title of the page or the name of the category. However, you can change both the label (the linked text) and the title attribute (the tooltip shown on hover). The original title will always be shown at the bottom of the menu item detail box, so you won’t lose track of the item’s source.


In the screen options, you can turn on some additional attributes for each menu item: the link target (whether the link opens a new browser window), CSS classes, link relationships (the same sort of XFN data you saw in the link manager in Chapter 4), and a description (which could be displayed below the link if your theme supports it).

You can create multi-level menus, To create a child menu item, simply drag it a little to the right. You’ll see its underlying drop zone, drawn in a dashed line, shift over to the right in preset intervals as you move the item.

This is the most  powerful way to customize existing WordPress themes while keeping the original code intact.

Subscribe to WordPress Arena’s Feed.

Reference and Resources:

WordPress Top Plugins

Digging Into WordPress

WordPress 3.0 jQuery: Enhance your WordPress website

How to add Tags to a WordPress Post?

If you’re familiar with the concept of tagging from social media sites like Flickr, YouTube, or Delicious, the tag feature in WordPress holds no surprises for you. Tags are subject keywords, just like categories, but where categories must be set up ahead of time by an editor or administrator, authors are free to create new tags simply by typing them into the Tag box while writing a post.

Note that after you’ve added new tags, you must press Add in order to apply them. Then, you still
have to press the blue Publish/Update button before your changes take effect.

To manage your tags, go to Post Tags in the main menu. Here, you can add or delete tags, edit slugs,
add descriptions, or convert tags to categories. Like categories, tag slugs must be unique—and since categories and tags share the same pool of slugs (they’re both considered taxonomies), a category and a tag can’t share a slug, even if they have the same name.

You can get feeds for each of your tags, as you’ll see in my next Post, so subscribe to WordPress Arena’s Feed.

Reference and Resources:

WordPress Top Plugins

Digging Into WordPress

WordPress 3.0 jQuery: Enhance your WordPress website

Should you Add Tags to your WordPress Website?
WordPress Coding: Programmatically Add Post Tags
How-To: Adding categories and tags to your posts
Put HTML tags into wordpress post title
Adding Categories And Post Tags Boxes For Custom Post Type In WordPress
How to Add WordPress Tag Support To Your Theme
How to add tags to a post in WordPress?
Posts » Tags

How to add navigation trail by using WordPress Plugin – BreadCrumb NavXT

Breadcrumbs typically appear horizontally across the top of a web page, usually below title bars or headers. They provide links back to each previous page the user navigated through to get to the current page or—in hierarchical site structures—the parent pages of the current one. Breadcrumbs provide a trail for the user to follow back to the starting or entry point. A greater-than sign (>) often serves as hierarchy separator, although designers may use other glyphs (such as » or ›), as well as various graphical treatments.

Typical breadcrumbs look like this:

Home page > Section page > Subsection page or Home page >> Section page >> Subsection page

Breadcrumbs are a very common feature to help users identify where they are in a website. For some reason, WordPress out of the box doesn’t have any built-in methods for dynamically creating this common design pattern. Fortunately, Mtekk and Hakre decided to take matters into their own hands and created Breadcrumb NavXT. This plugin creates a new PHP function to include in your posts and pages templates that generate a dynamic Breadcrumb.
You will find a slew of configuration options that allow you to control how your blog’s breadcrumbs will render. However, you might also notice that even once you installed the plugin, your blog still doesn’t have a breadcrumb! Don’t fret, this plugin requires you to add some code manually to your theme’s template files.

Inserting the Breadcrumb

The reason this plugin got the geek rating of Webmaster is specifically due to the fact that to leverage this plugin, you must edit your theme. Luckily, the process is fairly painless.

1. Visit Appearance | Editor and select either Single Post or Page Template from the list of available theme files.

2. Locate the top of your post’s content within the page’s HTML. This area is often located right above the code <?php while (have_posts() : the_post(); $count++; ?>.

3. Insert the Basic Breadcrumb snippet of code at the top of the page.

Basic Breadcrumb

<div>
<?php
if(function_exists(‘bcn_display’))
{
bcn_display();
}
?>
</div>

Download | Breadcrumb NavXT

Reference and Resources:

Digging Into WordPress

How to add the BreadCrumb NavXT Plugin to WordPress for Search Engine Optimization
Breadcrumb NavXT integration
Breadcrumb NavXT
WordPress Breadcrumbs Without a Plugin

Other WordPress Navigation Plugins

WordPress Navigation List Plugin NAVT at WordPress.org
WP-dTree 3.3.2 at WordPress.org
Sub Pages widget at WordPress.org
WP-PageNavi at WordPress.org
Pagebar at WordPress.org
WordPress Plugin: Simple Breadcrumb Navigation

How to Move a WordPress Site from one Server to another

If you ever need to move your WordPress installation from one server to another, start by reversing the
installation process.

Step 1: Download the WordPress files from your server. Make sure you have a complete copy of your
wp-config.php and .htaccess files and your wp-content directory.
Step 2: Export your database. If you have installed any plugins that create new tables, be sure to
include them in your backup. They will share the prefix (e.g. ‘wp_’) you specified during the installation.

You can install Austin Matzko’s WP-DB-Backup plugin (WP-DB-Backup)or use your host’s control panel (e.g.
PHPMyAdmin) to export your WordPress database.

Step 3: Put your old site into maintenance mode so your visitors can’t continue to submit comments
and trackbacks to your old database. Maintenance Mode plugin (Option 1, Option 2) works well.

Step 4: Edit your wp-config.php file. Change the database connection settings to correspond with the values on your new server. You should also define your site and blog URLs in the configuration file, This will override the settings in your database so you can log in on your new server. (Otherwise, WordPress would constantly redirect you to your old site!) See Editing wp-config.php for details on these and other advanced configuration settings.

Overriding database values for your site URLs in wp-config.php

define(‘WP_SITEURL’, ‘http://wparena.com.com);
define(‘WP_HOME’, ‘http://wparena.com’);

Step 5: Upload your files, including the modified wp-config.php, to your new web server.

Step 6: Import the database backup you made in Step 2 to your database on your new server using your new web host’s control panel tools.

Step 7: Log in to your WordPress site at its new location (e.g. wparena.com/wp-admin).

Step 8: If you changed your site’s URL, your posts and pages probably contain many hardcoded

paths to your uploaded media files. Use the Search and Replace plugin (Search and Replace) to change these to your new URL, as shown bellow.

You’re ready to begin transfer your site your site! Visit on the following links for more information about transferring your blog from one server to an other.

References and Other Resources:

WordPress Top Plugins

Digging Into WordPress

WordPress 3.0 jQuery: Enhance your WordPress website

How To Transfer WordPress From One Server To Another
How to move WordPress site to new server with zero downtime
How To: Moving WordPress to Another Server
How to Move a WordPress Site from one Server to another
How To Move A WordPress Site
How to Transfer a WordPress Blog From One Server or Host to Another
How to Move WordPress Blog to New Domain or Location
Move your WordPress blog to a new domain in 10 steps!

How to Use the Excerpt as a Description

The WordPress Excerpt is an optional summary or description of a post; in short, a post summary.
The Excerpt has two main uses: (WordPress Excerpt)

1. It replaces the full content in RSS feeds when the option to display summaries is selected in Dashboard › Settings › Reading.
2. Depending on the WordPress theme, it can be displayed in places where quick summaries are preferable to full content:
* Search results
* Tag archives
* Category archives
* Monthly archives
* Author archives

How to add excerpts to posts

To add an excerpt to a post, simply write one in the Excerpt field under the post edit box. An excerpt can be as short or as long as you wish. Usually, given its purpose, a couple of sentences is fine.
Interestingly, since the WordPress excerpt is similar in purpose to the META description of (X)HTML documents, excerpts can additionally be used as meta descriptions too. Some themes do this by default. It can also be done by means of an SEO plugin or a plugin for managing data in the head of (X)HTML pages.

Since the_excerpt() prints directly to the screen and can’t be passed to other PHP functions, you can’t wrap it in the esc_attr() function, as you normally would when using a template tag as an HTML attribute. Instead, you use the_excerpt_rss(). This function formats the excerpt for RSS feeds, but in this case it will work equally well in your description attribute, since excerpts can’t contain HTML.

Add this lines code between the <head></head> tags in the header.php file of your WordPress theme, which display the excerpt as the meta description tag for single posts and pages.

<?php
if (is_singular()):
global $post;
setup_postdata($post);
?>
<meta name=”description” content=”<?php the_excerpt_rss(); ?>” />
<?php endif; ?>

I have not discussed The WordPress Excerpt in detail but rather explained most important part. I tried to make some sense of it by focusing on what seemed essential to me and without going into too much detail. If you think there is still too much detail, or not enough detail, leave a comment to say so. If you are still satisfied read the following reference and I hope you will find WordPress Excerpt in detail.

Useful Resources:

The manual Excerpt in WordPress
Ultimate Guide to WordPress SEO – META Descriptions
How to use the Excerpt field from WordPress for SEO
WordPress meta description using post excerpt, category description and post ID
The WordPress excerpt: What, why, how, tips and plugins
Using WordPress Excerpts
Change excerpt length in wordpress

WordPress Top Plugins

Digging Into WordPress

WordPress 3.0 jQuery: Enhance your WordPress website

How to Use Categories and Tags as Keywords

A tag, or keyword, is a word or phrase that’s descriptive and specific to your article or webpage. The right keywords will help optimize your exposure and also your positioning in search engines, which is where many people may find your article.

Adding meta keywords to your single post archive template, you have all the data you need: your categories and tags. All you have to do is get a combined list, separated by commas. You first use a conditional tag to make sure this code is used only on single post archives. (Pages don’t have categories or tags, and the get_the_tags() and get_the_category() functions won’t work correctly on archive pages containing multiple posts.) Then, for each tag and category, you force the name to all lowercase and add it to an array of keywords. As you print the <meta> tag, you remove duplicates from the array with array_unique() and convert the array to a comma-separated string using implode().
In the Following lines of code you will learn  how to build the array of keywords and print it as the content of the <meta> tag.

Creating meta keywords tag from post categories and tags in header.php

<?php if (is_single()) {
foreach((get_the_tags()) as $tag) {
$keywords[] = strtolower($tag->name);
}
foreach((get_the_category()) as $category) {
$keywords[] = strtolower($category->cat_name);
}
?>
<meta name=”keywords” content=”<?php echo implode(“, “, array_unique($keywords)); ?>” />
<?php } ?>

By making these changes in your theme’s header file is to help improve search engine optimization. All in One SEO Pack- WordPress  Plugin will help you to write good  tags and you can easily implement them on your WordPress-powered site. You can find detail on this link: How to improve WordPress title tags.

References and Other Resources:

Basic SEO with Categories, Tags and Keywords in WordPress
How To Utilize Your Categories and Tags More Effectively
How to Use Tags and Keywords More Efficiently
Using Categories and Tags Effectively on Your Blog
Videos for How to Use Categories and Tags as Keywords
WordPress Tags vs. Keywords
WordPress Tag Cloud Plugin to generate Visual 3D tags
WordPress Tip: Rotating Flash Tag Clouds
Customizing WordPress Tags Cloud – A Guide

WordPress Top Plugins

Digging Into WordPress

WordPress 3.0 jQuery: Enhance your WordPress website

Free & Professional WordPress Security Service Free & Professional WordPress Security Service

We Love WordPress. WordPress Arena is a place for WordPress Developers and Designers, providing Tips, tricks, tools and resources to build a website or blog on WordPress. We also present The WordPress Showcase for all kind of WordPress Powered Websites.

Recent Comments

Tink Seagraves

|

Seems to have a little crush on G-Dub!