Tag Archives: wordpress

Wordpress: Formatting get_the_content() return data

14 Jun

Guess whose finally back? Me! That said, you know how get_the_content() and the_content() return the post content, but get_the_content() doesn’t apply the_content() filters? Yeap it’s a pain, rather it was. Thanks to Web Templates NU you can save some time and add the following to your themes functions.php file.

function get_the_content_with_formatting ($more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {
	$content = get_the_content($more_link_text, $stripteaser, $more_file);
	$content = apply_filters('the_content', $content);
	$content = str_replace(']]>', ']]>', $content);
	return $content;
}

Read all about it here: get_the_content() function using formatting filters

Wordpress: Adding a theme options page

31 Dec

Wordpress: Adding a theme options page

Been working on wordpress themes the past month and found the following article helpful.

Including a Theme Options page for your theme is one of the best ways to increase ease-of-use for managing a complex theme. However, a few quick Google searches later and most people give up. Such a great inclusion for theme design appears to have such little documentation, that it appears to be one of those heavily guarded secrets which only the crème de la crème of designers hold the key to.

In this article we will be incorporating an options panel for the ‘WordPress Classic’ theme. The methods you learn will allow you to very easily integrate it into an existing theme you’re working on.

Read it – Create an Options Page For Your WordPress Theme

how to: Disabling the built-in syntax highlighting WordPress 2.8

23 Sep

I was initially excited about the CodePress syntax highlighting in WordPress 2.8, although after actually using it recently, I changed my mind. While just the syntax highlighting alone is not a problem, the way it completes quotes, and auto indents makes it somewhat annoying to say the least.

I asked on Twitter, and found a thread on the WordPress.org support forums, but unfortunately couldn’t find a solution on either. It turns out the solution was actually a lot simpler than I thought. Watch this quick video to see how to disable it:

Jump:
Disable Syntax Highlighting in WordPress 2.8

Importing posts wordpress posts or how to get around these dang 500 errors

18 Sep

I’ve been wanting to import my old wordpress posts for a while, but for some reason I’m stuck getting 500 errors. On the second attempt I adjusted timeouts in haproxy’s configuration. Third time, I debugged for 10 minutes, 3rd time I think I drank a beer, and after the 4th time I remembered the easiest way to reach a goal is to get around a problem.

My solution was to split up the export file from my previous wordpress install. All you need to do is copy your wordpress export file multiple times, then divide the post entries among them. It’s actually alot simpler than it sounds. Each post is contained in an <item> element, so as long as you match the tags you’ll be fine. Then bob’s your uncle, and I’m still not British

Lates,
Sid

wordpress: WP-Testimonials

18 Jul

came across this yesterday.

WP-Testimonials is a plugin for WordPress that lets you display your customer/client/product testimonials on your blog.

You may add, edit or remove testimonials through the “Manage” navigation tab in the admin area. The plugin includes the option to display a random testimonial in your sidebar using PHP code for older templates or using a widget for newer themes. The widget is built-in with the plugin, so you have no additional files to worry about.

Testimonials can also be displayed all on one page. A template file is included that will need to be uploaded to your theme directory. Once in place, simply create a new page and select that template from the drop-down.

check it out :
http://www.sunfrogservices.com/free-php-script-downloads/wp-testimonials/

importing xml to mysql with php

18 Jul

i prefer to handle data either in arrays or classes, or better yet, arrays with classes.

That said. get an xml to array script, like this one made by : Razzaque Rupom. It’s my favorite.

http://rupom.wordpress.com/category/phpclasses/

why I choose the mit license

14 Jan

I’ve been slowly working on moving all of my projects and tutorials to one site. Mainly because there treated like blog posts instead of projects. This of course lead me to start looking at which license to start looking at which license to release everything as.

After a few days pouring over everything on the web I decided to choose the mit license. Why? The mit license fits how I want to release my code. It releases my code openly to anyone, only asking that the copyright in my code remain.

This will probably lead to you ask why not gpl, apache, or bsd?

why I didn’t choose gpl

the gpl license [http://en.wikipedia.org/wiki/GNU_General_Public_License] is restrictive IMO, due to the fact that it forces a user to release anyone that uses what i create under gpl as well. This is not to say that the gpl is wrong, just that its restrictive to end users / developers in a way I choose not to me. If someone takes code that I am openly releasing, I don’t want to limit them in anyway other than to leave a portion giving me credit for my portion of code, that’s it.

If i was working on some huge next best thing (think wordpress) and planned to release it, then I would use a gpl license. why? something like wordpress could easily be exploited commercially. If I take the time to build something like that I would want anyone who decides to change it or build off of it to release it themselves, to also make sure it’s free under the same license. The biggest difference here is intent. If you were to create the next swfobject.js (which uses an mit license), why restrict your users? But if your creating the next wordpress you don’t want to restrict users, just ensure that your work continues to be free.

why i didn’t choose bsd

the bsd license is similar to the mit license, but with an advertising clause. So to prevent anyone from any legal issues (who knows what counts as advertising in the future), why restrict end users?

why I didn’t choose apache

the apache license is the default license for projects at google code (you can select others), so it’s gotta be good. But it feel slightly more restrictive. That said: I’m releasing anything that uses patents. If you are then an apache license might be for you if you’d like to not restrict users.

in a nutshell

I think the best quote I came across was from eagain.wordpress.com:

if you want software to be free GPL is better than BSD. If you want use of software to be free BSD is better.

I think mit/bsd licenses are better for developers when your creating random things that might help someone (think swfobject). gpl is better if your developing an application to help everyone (think wordpress).

sid

*update* – found another good article:

http://fosswire.com/2007/04/06/the-differences-between-the-gpl-lgpl-and-the-bsd/

indigo6, another professional site using wordpress pretty well

23 Dec

came across this site to day while tossing around ideas for my new site: http://indigo6.com

It’s a good example of a professional site using wordpress.

plugin: create a social network with buddypress and wordpress mu

21 Dec

From: http://buddypress.org/about/#profiles-box

BuddyPress will extend WordPress MU and bring social networking features to a new or existing installation.

BuddyPress is essentially a set of WordPress MU specific plugins. Each plugin component adds a distinct feature to BuddyPress and only handles functionality for that specific component (for example, private messaging). BuddyPress also has a core plugin that all other plugins require, it contains shared functions and performs the basic modifications to the WordPress MU interface.

Each BuddyPress component is independent. This means you can pick and choose which features you’d like.

It also means BuddyPress can be used in two different ways. You could use BuddyPress to create a complete social network from scratch, or you could use it to add desirable features to your existing blog network.

Check It Out:
BuddyPress » About BuddyPress

wordpress hooks database

15 Dec

Sadly wordpress doesn’t maintain a complete list of all action and filter hooks. Lucky for us adam brown does

From: http://adambrown.info/p/wp_hooks

If you’re a plugin developer, you know how difficult it can be to figure out which hooks are available. This WordPress hooks database automatically scans each WP build for apply_filters() and do_action() to figure out exactly which hooks are available in each version and where the hooks occur.

If you don’t know what WordPress hooks are for, read the Plugin API .

Check It Out:
WordPress hooks database – action hooks and filters for all wp versions || Adam Brown, BYU Political Science