Viewing posts tagged with: Wordpress

May 5th, 2008 How to Profit with the Open Source Community

I love open source software. I love the idea of open source software. Involving people in the development process that would not otherwise get the chance. Tapping into talent that would not normally be available to you. Best of all, giving everyone the opportunity to benefit others as they benefit themselves. I’m always interested in how I can benefit the communities that I’m a part of.

The question that I’m asked most often when I talk to people about open source software is “Who pays for all this?” as well as variants like “Then how do they make money?” or “Won’t people eventually stop working for free?” We live in a capitalistic society, and people don’t understand why someone would work for free when they could be making money. In this article, I’m not going to cling to ideals on why doing something for the community shows more worth than your bank account balance, instead I’m going to explain how open source developers (myself included) do in fact make money by developing quality software for free. Hopefully in the process you will find a way to give back to the community and get your piece of the pie.
Read the rest of How to Profit with the Open Source Community »

April 15th, 2008 WordPress 2.5 Shortcodes

Warning: Shortcodes are affected by Trac ticket 6444, which was fixed in WordPress 2.5.1.

First I touched on the topic in my first impressions of WordPress 2.5. Then I whined a little about the tickets relating to them, and eventually I released my Google Maps Plugin that uses them. In the end, WordPress’s new shortcodes are really nice.

What are they?

First of all, a shortcode called “mycode” can look like any of these:

[mycode]
[mycode foo="bar" id="123" color="red" something="data"]
[mycode]Some Content[/mycode]
[mycode]<p><a href="http://example.com/">HTML Content</a></p>[/mycode]
[mycode]Content [another-shotcode] more content[/mycode]
[mycode foo="bar" id="123"]Some Content[/mycode]
 

As you can see, shortcodes allow a user to put a code into a post or page, and a plugin can then easily handle those codes. They can be nested, contain content (including HTML), attributes, etc. Sounds great, but how can you leverage shortcodes for your benefit?

How can I use them?

You want to leverage the new, powerful shortcode system in WordPress 2.5, but where do you start?
Read the rest of WordPress 2.5 Shortcodes »

April 14th, 2008 Google Maps for Wordpress

Download from wordpress.org

Warning: This plugin was affected by Trac ticket 6444, which was fixed in WordPress 2.5.1, so get 2.5.1!

The Google Maps for WordPress plugin allows you to easily insert Google maps into your blog, making use of the new shortCode system in WordPress 2.5. The maps can be configured to offer directions to or from the location, show or hide the zoom/pan controls, show/hide map type, activate zoom using mouse wheel, and more.

It requires a Google Maps API key, and then gives you a nice interface near your editor to help you build the map and send it to the editor.

April 14th, 2008 Wordpress Twitter Widget

Download from wordpress.org

My latest plugin is a sidebar widget that handles Twitter feeds. It’s true that you could just point and RSS widget at one of the Twitter feeds, but you end up with the whole tweet (I honestly don’t know what they are called) as a link, @replies don’t function, etc. Twitter Widget Pro properly handles twitter feeds, including @username and link parsing, feeds that include friends or just one user, and can even display profile images for the users. It’s set up like the RSS widgets, so you can have as many of as you want on your sidebars.

I currently have my twitter feed in the right sidebar, showing the last five tweets, and Kevin Rose’s feed (with friends) in the left sidebar, showing profile images along with each of the last 10 tweets.

I tried to make everything easily styled, so there are no built-in styles. If you don’t know exactly what you need, here is what I’m using on this site:

/**
 * Twitter Widget
 */
.widget_twitter li {
	clear:both;
}
.widget_twitter li img {
	float:left;
	margin-right:.5em;
}
.widget_twitter li .clear {
	clear:both;
}

Read the rest of Wordpress Twitter Widget »

April 2nd, 2008 WordPress 2.5: First Impressions

WordPress 2.5 was recently released. I’m not your average WordPress user, I develop plugins, test the upcoming releases, and even contribute to the core when I can. Why do I say all this? I hope it will give you an idea where I’m coming from, as I share my first impressions of WordPress 2.5.

Writing Posts

The first thing that stuck out to me (and that I had been waiting for) was the tag suggest feature. Simply start typing a tag, and an auto-suggest feature will give you a dropdown of existing tags to choose from. Before, it was too easy to end up with tags like “web development” and “webdevelopment” since you had to remember them (no one actually looks them up).
Wordpress 2.5 tags

This brings me to the new way media is managed/added. I haven’t had the need to add videos or sounds to my site, so I’ll stick to the images. In the end, I like the new way it works. The Flash uploader is nice, and the addition of a medium option for each image (thumbnail, medium, full size) is a welcome change. However, nice as it is, there is one thing about it that is REALLY annoying. Full size isn’t actually full size. It’s 500px wide! What’s the point of calling it “full size” and then not making it “full size!” If they want small, medium, and large, they should call it that (although I still think there should be a full size option). There is however a simple solution. You can set $content_width inside your theme’s functions.php file, and it will use that instead of 500 for the max width. I set mine to 1024:

<?php $content_width = 1024; ?>

Unfortunately, this isn’t a standard that was in place, so themes do not have this. It’s a hack, and it’s shouldn’t be needed.

The last thing I wanted to mention, which is very minor, but annoyed me, is that you can’t resize the editor window when in HTML mode. I almost always use HTML mode, and I thought they had removed the ability to resize the text area. as it turns out, you need to switch to the visual editor, resize it, and switch back.

Admin Layout

I don’t like static width layouts. Have dual screens that both run at 1680×1050, and I run my browser full-screen because that’s the way I like it. My laptop runs at 1920×1200, and I even run full-screen on that. Instead of having more room to work, I am rewarded with more than 40% of my screen wasted as blank white space. Having said this, I’ve seen far worse layouts, and it’s fairly intuitive. You can expect plenty of plugins to fix this. Right now (as I’m typing this), what I have done is use firebug to inspect the HTML, found div#wrap, and altered the style by removing max-width:980px;. This seems to work fine for me.

Plugin API

For me, this is the most exciting change. I love the new shortCodes. They are a little rough around the edges, but they are extremely handy. As a matter of fact, I just finished a Google Maps Plugin that uses the shortCodes. It generates a shortCode based on the settings a user chooses, and insert it into the editor. It later handles those shortCodes by changing them out for a Google Map. Unfortunately it relies on the ticket referenced above, so I’ll release it once that gets figured out.

Summary

WordPress 2.5 is definitely a big step forward. It has some small inconsistencies, which I expect to be easily fixed in upcoming minor releases, but nothing that should keep you from upgrading. Go try it and tell me what you think.

January 28th, 2008 Free Template: Minimalist

MinimalistMinimalist is an extremely light weight, configurable template, with no images at all! It’s completely fluid, so no matter what the user’s screen width, you don’t waste any space, browser font resizing is completely supported, and it is source-ordered. It includes stylesheets to display main content on the left or right, as well as many alternative colors including grey, green, blue, purple, red, and brown! It validates as XHTML Strict 1.0, and is released as Public Domain. It is available for download over at OpenDesigns.org.

I just converted Minimalist to a WordPress theme, and uploaded it here for anyone that wants it. I was lazy, so it defaults to green/grey with content to the left. If you want to use a different combination, edit the header.php file to use whatever css files you want (all are included). I also included a contact page template, but again was a little lazy, so you will need to edit contact.php and put your contact info on lines 73-75, as well as your E-Mail address on line 17. The only other real changes that were made was styling for comments (as well as unique styling for admin comments), and I added a pencil icon to use for “editing” (it’s still image free for your users).

Attached Files:

January 11th, 2008 Validate Empty Wordpress Posts/Pages

Empty posts/pages in wordpress still get wrapped in tags, which makes them invalid. This plugin fixes that.

Attached Files:

January 11th, 2008 Wordpress Script Handling

Wordpress has some great stuff for handling scripts. You can use wp_enqueue_script() or wp_register_script() to handle scripts. Since there are some scripts that I use so regularly, I decided to automate the process a little more. Basically, I create a js directory inside my template directory, and place the JavaScript files I plan to use there. Each can have certain keywords in the comments at the top of the file to set it’s handle, version, dependencies, as well as whether to enqueue it automatically. The comments may look something like:

/*
Handle: xavisys
Version: 0.1
Deps: scriptaculous-effects
Enqueue: true
*/
 
/*
Version: 1.5.4.1
Handle: validation
Deps: scriptaculous-effects
*/
 
/*
Handle: x_contact
Version: 0.1
Deps: validation
*/

Basically, if enqueue is set to true, it will automatically load the file. Otherwise, it will just register it, so that you can use the handle to enqueue it when needed. All you need to do is add the following code to your functions.php file:
Read the rest of Wordpress Script Handling »

January 10th, 2008 Wordpress Mark Parent Pages Plugin

Update: This plugin is not needed in 2.5, it has been included in the WordPress core.

This plugin uses DOM to add a class (current_page_ancestor) to the li tag of each page that is an ancestor of the current one. With a little CSS, you can have nice collapsing menus. This code assumes that your pages are listed using the usual wp_list_pages function, and that they are in an element with the id of nav.

#nav ul li.current_page_item ul,
#nav ul li.current_page_ancestor ul {
    display:block;
}
#nav ul li.current_page_item ul ul {
    display:none;
}

I wanted collapsing menus in Wordpress, not Javascript based, but something that would display only top level pages AND pages that are either children of the current page or children of the ancestors of the current page. It may sound confusing, but it’s really quite logical. Take a look:
Read the rest of Wordpress Mark Parent Pages Plugin »

Attached Files:

January 10th, 2008 Wordpress Should Update get_sidebar to Work With Multiple Sidebars

I submitted an enhancement to wordpress yesterday, to allow get_sidebar to work with multiple sidebars. It’s an extremely simple fix, and you end up with a function that looks like this:

function get_sidebar($name=null) {
	do_action( 'get_sidebar' );
	if ( isset($name) && file_exists( TEMPLATEPATH . "/sidebar-{$name}.php") )
		load_template( TEMPLATEPATH . "/sidebar-{$name}.php");
	elseif ( file_exists( TEMPLATEPATH . '/sidebar.php') )
		load_template( TEMPLATEPATH . '/sidebar.php');
	else
		load_template( ABSPATH . 'wp-content/themes/default/sidebar.php');
}

By adding two lines and one optional parameter to the get_sidebar() function, you would be able to pass it a sidebar name. For example, get_sidebar(’left’) would load the template TEMPLATEPATH . ’sidebar-left.php’ allowing you to have multiple sidebar files as part of your template.
Read the rest of Wordpress Should Update get_sidebar to Work With Multiple Sidebars »

Search