‘WordPress’ Category

June 20th, 2010

WordPress 3 New Features

WordPress 3.0 release has some awesome new features added to it.

How about the integration of Multi-Site functionality!

This allows us to have multiple sites for one install.

We can now easily

  • Have multiple sites
  • Show demo sites
  • Allow others to signup for a WordPress site
  • Even sell WordPress sites if you want and have the know how to set it up.

There is a small tweak to turn the multi-site feature on,

Edit your config.php

Before:

Select All
1
/** Absolute path to the WordPress directory. */

ADD:

Select All
1
define('WP_ALLOW_MULTISITE', true);

Now in your Admin Dashboard under tools there will be a Network link.

It is there that you configure your network for multi-site and follow it’s further instructions.

Another new feature is the Custom Navigation Menus.

To activate this in existing themes you have to add the Menu registration function to the functions.php

For single menu simply add

Select All
1
2
3
4
5
add_action( 'init', 'register_my_menu' );
 
function register_my_menu() {
	register_nav_menu( 'primary-menu', __( 'Primary Menu' ) );
}

Then display it by calling wp_nav_menu(); function like this
I’m adding a condition here, you don’t have to.

Select All
1
2
3
4
5
6
7
8
9
10
11
12
13
14
if ( has_nav_menu( 'primary-menu' ) ) {
   wp_nav_menu( array(
        'sort_column' => 'menu_order',
        'container_id'    => 'page-nav',
        'container_class' => 'my-nav-class',
        'menu_id' => 'menu',
        'menu_class' => '',
        'link_before'     => '' ,
        'link_after'      => '' ,
        'depth'           => 3,
        'theme_location' => 'primary-menu',
        'fallback_cb' => ''
    ) );
}

You can see I added some arguments to it for styling purposes.

A full list of arguments can be found here wp_menu_nav()

One issue with this menu is that it adds the UL element to the menu for you.

This proposes an issue when you want to add a link to your template.

Say you want to add a floated link to the far right of the menu, without adding a bunch of new markup.

You need to use a filter. To do this add a variable to the place you are calling the wp_nav_menu() function like this.

Select All
1
$my_menu =  wp_nav_menu( $then_Your_args);

Now in the functions.php we add a filter that looks something like this

Select All
1
2
3
4
5
6
7
8
9
function wp_nav_menu_add_menuclass($my_menu) {
    return str_replace(
            '</ul></div>', //Find the end of the menu
            '<li id="phone-tab"><a href="#" title="Contact Phone Numbers">Contact Info</a></li></ul></div>', //Add link
            $my_menu
        ); 
 
}
add_filter('wp_nav_menu','wp_nav_menu_add_menuclass');

This will search out the closing UL and DIV elements for the menu and replace them with the new content.

If you want to add Multiple Menu Support simple add an array like this

Select All
1
2
3
4
5
6
7
8
9
10
11
12
add_action( 'init', 'register_my_menus' );
 
function register_my_menus() {
	register_nav_menus(
		array(
			'primary-menu' => __( 'Primary Menu' ),
			'secondary-menu' => __( 'Secondary Menu' ),
			'tertiary-menu' => __( 'Tertiary Menu' )
                        'cat-menu' => __( 'Category Menu' ),
		)
	);
}

There are plenty of other examples in the new default theme TwentyTen.
Like adding custom styles to the editor
Eg.

Select All
1
2
//Allows use to add custom styles to the editor
add_editor_style();

Then create an editor-style.css file
See TwentyTen theme for an example.

If you have anything specific you would like me to write about or an example of something you would like me to go over let me now via twitter or use the contact page here.

May 1st, 2010

More WordPress Templates

The building block of most sites is a portfolio!

I just created more custom theme page templates for the up coming VW Pro WordPress theme releases.
These are for portfolios or basically anything you want in this type of layout.
They are page templates that you can assign a category to and create endless portfolio type pages..

Horizontal Layout
Vertical Layout

As you can see in the vertical layout, the text is automatically converted to an excerpt and shrunk so the layout is even in size.

In both layouts the images are automatically cropped and linked via FancyBox jQuery light box effect animated popup display of the full size image as seen here when clicking on the images posted.

The images are inserted in the post via the custom post options in the post editor included with VW Pro Themes.

April 29th, 2010

Some VW Pro Theme Additions

VW Pro Theme Options Page

I added some tweaks to the VW Pro Theme options page.
It really looks awesome now and is quite a bit easier to navigate with collapsing blocks for each of the many theme options categories.
Also each category has it’s own save button.

The New VW Pro Contact Form

I added another option to the form allowing you to set a priority field with configurable drop down options.
DEMO
I absolutely love the reCaptcha :)

Some FeedBurner Changes

I recoded the FeedBurner feature entirely with error checking and statistics included.
Basically if it fails, it will tell you with the FeedBurner error message.

Side Note:
Future customers, you can add this code to your .htaccess file and redirect all WordPress RSS links to your FeedBurner Feed.
Make sure you change the Your_Id

Select All
1
2
3
4
5
6
7
# temp redirect wordpress content feeds to feedburner
<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond %{HTTP_USER_AGENT} !FeedBurner    [NC]
 RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC]
 RewriteRule ^feed/?([_0-9a-z-]+)?/?$ http://feeds.feedburner.com/Your_Id [R=302,NC,L]
</IfModule>
VW Pro Twitter Features

I coded a completely new twitter options for the sidebar.
It now shows all of the stats, options to show the profile picture and up to 20 of the latest tweets.
Also configurable height so you can have a scroll bar instead of a long list of tweets.
Absolutely no javascript or external javascripts required. This is entirely PHP and cached for an hour.
You can view these changes in the sidebar here to the right.

New FaceBook Like Options

Added the newest FaceBook feature, FaceBook Like.
This feature has options to show or not show the profile pictures of the users that liked the post.
It also has options to show the like button on the blog and/or single post page.

I will be adding even more features, if I can come up with some. Running out of ideas………

The first WP Pro Theme should be for sale very soon!

Full Browser Support

April 27th, 2010

Twitter Feeds in WordPress

Well I finally took the time to make the full feed for the sidebars in VW Pro WordPress themes.
It has some nice features, and is cached to keep compliant with Twitter.

VW Pro WordPress Twitter Feed Features
  • Display up to 20 tweets or limit them to as little as the latest 1
  • Display Twitter profile picture or not
  • Change the feed title
  • Display stats or not
  • Show screen name or not
  • Adjustable Feed height

These are all adjustable via the VW Pro Theme options panel.
This is also all pulled via PHP so there are no extra Javascript files loaded.

April 25th, 2010

VW Pro Themes Contact Form

This is the all new Contact Form built into and available in Valid-Webs Premium WordPress Themes.
It boasts the awesome reCaptcha spam protection and many options available via the extended theme options panel.
Settings in the options panel

  • reCaptcha Public API Key
  • reCaptcha Private API Key
  • Default email address
  • Carbon Copy (CC) email address
  • Show General Options or not
  • General options input box, as many as you want separated by commas.
  • Show Found Us Where or not
  • Found Us Where input box, as many as you want separated by commas.

General Options can be useful for listing services to select from for a pre-Subject.
Found Us Where is very useful for keeping up on how people are finding you when they submit a message.

Some other features that get added to each message,

  • Users browser details (User Agent)
  • Users IP
  • Submitted Date
  • Referral URL

These extra details give you the necessary info to block someone should they abuse the contact form.
Demo