Author Archive

The “More” Tag on a WordPress Page

31
responses

Nathan Rice wrote about WordPress’s ability to make any page a homepage. One problem I ran into using the technique of pages was the inability to use the <!–more–> tag to display partial posts. Apparently this is default behavior (for good reason) on pages. However, when using Nathan’s technique, I found myself in a unique situation where I only wanted to show a partial post (on a page) if the post was making use of the <!–more–> tag (apparently, I’m not alone). The technique is rather simple. Simply declare a variable named $more as a global and set it to false right before showing your content. If you wish to resume normal behavior after the content is shown, simply set the variable back to true. <?php global $more; $more = false; ?> <?php the_content('Continue Reading'); ?> <?php $more = true; ?>

[Continue Reading...]

Reduce the Size of Your WordPress Plugin Footprint

19
responses

For each WordPress plugin you install, you are adding to the bandwidth/server overhead of your site. As a plugin author, there are some simple steps to take to reduce the footprint of your plugin (whether it be helping with server load or conserving bandwidth), even if your plugin still requires a lot of code. Break Out Admin Panels Into Separate Files Even for simple plugins, adding admin panels can easily balloon a plugin’s file size. A simple, yet effective technique, is to copy the code used for the admin panel to a separate file and simply provide an include in the function that loads the admin panel. For example, say you load in your admin panel using this code: add_options_page(‘Plugin Name’, ‘Plugin Name’, 10, basename(__FILE__), ‘printAdminPage’); The function printAdminPage is going to be the function that loads the admin panel. Within this function you could have: function printAdminPage() { include […]

[Continue Reading...]

Dissecting a Plugin: Better Comments Manager

8
responses
by
on
June 18th, 2007
in
HOW-TO, WordPress Plugins

One question I’ve been receiving a lot lately is regarding editing or traversing WordPress plugin code. The question more-or-less is, “Where do I start?” It’s a hard question to answer since every plugin is different, but there are a few ways to get a handle on how a plugin works. I feel a real-world application is needed to show how to edit plugin code, so I am going to periodically dissect a plugin and show you the innards by adding in a few simple features. The first plugin to be dissected is called Better Comments Manager (version 1.2). Ajay did a good job reviewing the Better Comments Manager plugin, so I suggest you check out the review to get a good overview of the plugin. In this dissection, we will be adding/modifying two simple features to the plugin: Disable the scrolling effect when replying to a comment. Add the panel […]

[Continue Reading...]

Listing Your Plugin at the WordPress.org Plugin Directory

50
responses

With the WordPress Plugin Competition 2.0 in full swing, some plugin authors may want to have their plugin listed at the official WordPress.org Plugin Directory. Within this post I will go over the steps necessary to get your plugin hosted by WordPress. This tutorial is for Windows users, but I will link to other tutorials as they become available based on other operating systems. The WordPress directory uses Subversion, which won’t be covered in detail here (you don’t need to know Subversion to follow this tutorial). The tutorial covers adding a plugin I wrote called Feed Styler into the plugin directory. I apologize in advance for the plug, but I wanted to provide a real-world step-by-step example of adding a real plugin. 1. Get a WordPress.org Account Get over to the WordPress support page and register as a user. You will need to be registered in order to list your […]

[Continue Reading...]

Global Variables and the WordPress Loop

40
responses
by
on
June 6th, 2007
in
WordPress FAQs, WordPress Tips

My name is Ronald Huereca and am a new author here at WLTC. I come from a technical and business background with a degree in EET and a MS in Business Administration. I hope to share with the WTLC readers some of little intricacies of WordPress, whether it be theme or plugin related. I have written a few plugins, one called Feed Styler and the other Ajax Edit Comments. I currently write for my personal blog, the Reader Appreciation Project, and Devlounge. I am open to any and all feedback, so if there is something you’d like to see me write about, please let me know. When coding a WordPress plugin, one thing that must be quickly mastered is that of the WordPress loop and global variables. Once mastered, a plugin author can tell which global variables are accessible, and which are not. With certain WordPress Action and Filters, it’s […]

[Continue Reading...]



Obviously Powered by WordPress. © 2003-2013

css.php