Posts Tagged ‘themes’

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.

April 22nd, 2010

Behind the design

The point behind the current design on Valid Webs is not the aesthetic aw that most WordPress designs focus on using large graphics or fancy images.
My key focus in this design is a common layout to work with for my future VW Pro Theme releases.
The key points of interest being

  • Speed (Load Speed)
  • SEO optimized
  • Plenty of bells and whistles with caching
  • Overall very heavily featured theme without side affects!

The list goes on, look around and you’ll see all of the extra features added and there is only one required plug-in.
The rest is built in and cached.

At the same time having graphic that are minimal and optimized and also places as sprites.
My biggest goal is to cram as much feature rich functionality in as I can without dragging the page or site down.

I see a lot of premium themes loaded up with great features, but then the page load speed drops out.
My goal is to avoid this by highly optimizing the theme as a frame to work from in the future of my designs.

Keep in mind that Google’s newest item added to their page ranking algorithm is page speed!

April 5th, 2010

VW Pro Feature List

WordPress Optimized Premium Themes

Custom Theme Admin Options

1) Featured Article Options
2) Twitter Feed Options
3) ReTweet Options
4) Face Book Options
5) Extra Sexy Social Bookmark Options
6) Post Ad options (Show or Disable)
7) Custom Rating System (Editor Button also)
8.) Simple to use rating [rate class="gold"]5[/rate]
Up to 5 stars Gold, Red, Green, Grey, Blue

9) SEO Post Editor Blocks (Title, Desc., & Key Words)
10) Ad Image & Ad Text post editor blocks
11) Automatic post thumb (upload any size auto adjust)
12) Post Thumb loads large image in animated Fancy Box
13) Fancy Box post button in post editor
14) Extra formatting buttons in editor
15) Custom user only content button in editor
16) Members only content button in editor via (Members Plug-in)

17) Lightweight, reduced Database queries and HTTP requests. All CSS, JavaScript, and icons are compiled.

18) Side Bar Follow Me block RSS, Twitter, Face Book, and Feed Burner form.

19) Side Bar About Me Option, Image & Text
20) Side Bar Ajax Tabbed standard block, Categories, Recent posts, and Archive

21) Side Bar Ajax Tabbed Links block, configuration. Roughly 3 link category tabs.

22) HTML Column posting buttons for 2 column posts.
23) Quick Admin Links block
24) Custom sidebar block positions
25) Side Bar ads block, up to 6, 125px x 125px images
26) All options have On/Off
27) Adjustable text
28) Custom read more icon
29) Side Bar login block
30) Ajax show/hide comments with cookie

Additional Theme Extras

1) Popular Posts
2) Recent Posts
3) Recent Comments
4) Related Articles
5) All icons are in a compiled Sprite
6) Ratings in 5 colors Gold, Red, Green, Blue, Gray. All in 1 sprite image.

7) Authors Block in each post, On/Off option
8.) Post meta On/Off option
9) Tiny Url Shortener on built in ReTweet
10) Custom Author Page
11) Custom Human readable Site Map of all links.
12) Integrated WP-pagenavi
13) Breadcrumn post navigation
14) Lower database queries beause of less pluggins.
15) Extra Templates =
16) Portfolio Layout
17) Portal featured blocks front page
18) Author page
19) Site Map
20) Members Only
21) SECURITY remover WP versioning in code

This list is not yet complete!

April 5th, 2010

VW Pro WP Theme Options

Sample editor features of VW Pro custom themes.

These features are built into the HTML editor through a custom script in VW Pro Word Press themes.
This allows creating fancy posts quick and easy with a ton of features to use in each post.

Custom information blocks
Some defualt text.
Some defualt text.
Some defualt text.
Some defualt text.
Some defualt text.
Custom star ratings
  • Rate this one gold [rate class="gold"]5[/rate]
  • How about a red [rate class="red"]3[/rate]
  • Some blue [rate class="blue"]2[/rate]
Custom list with ticks
  • Item one
  • Item two

We even have custom members and non members buttons allowing you to have different content in a post for members and non members via a WP Members plugin.

More to come..

Screen shots of the post editor extras

View of the extra editor buttons

SEO and post image options built in.

Built in rating system with key FAQ’s, screenshot, and customizable rating definitions.

Custom taxonomy to relate posts to pages.

When using this feature a Related Posts list with links are shown on the page it is used on.

December 11th, 2009

Benchmark Your Themes

I have been getting deeper into development with Word Press, mostly styling but none the less working in Word Press because the fact of the mater is that there is a market for it. The point of this post is this, building a dynamic site can get quite heave very quickly, especially in WP. If you add a bunch of plug-ins which are loaded dynamically then add a custom theme that you maybe even paid a premium price for, your database queries can go through the roof.

For instance, WP has like 9 queries on an empty page with no plug-ins, that’s a lot already. Now add one of the themes out there with a couple rows of featured posts blocks. One thing that I noticed looking through some of these fancy themes is that they are running a ton of queries to get these featured posts.

Add 3 rows of 3 and a couple plug-ins and you are well over 50 queries.
Now have 100 visitors at a given moment on that page, that is a minimum of 5000 database calls in that moment.
You had better have an excellent host!

I’ve also seen this with dynamic Ajax scroll-er plug-ins.
3 posts to grab content from in one category and its 7-9 queries. Something is not right there, guys.
You should be able to grab that content in 2 queries, 1 if the database structure was descent (but that’s a whole different game).

For you out there with front pages like this, do yourself a favor, especially if you have had issues in the past.
See how many queries are loading and how long it takes, it’s simple to do.

In your theme’s footer.php template before the closing

</body>

Add

Select All
1
<?php echo get_num_queries(); ?> queries. <?php timer_stop(1); ?> seconds.

Now your pages will show you how many queries there are for each page.
You can determine what to do from there.

As a further note on the subject, you can have a featured content page and have a bunch of blocks and not have it take a bunch of database queries.
Stay Tuned and I might tell how :)