6/19/2008 ↓

How to: Offsets and Paging 14comments

Author: Ronald Huereca Category: HOW-TO, WordPress Hack

Reader John writes in:

How does one use paging with an offset? Doing so breaks the navigation controls.

The problem with using an offset in a query is that WordPress ignores any reference to paging. In other words, you can use an offset and paging, but not both together.

This can be solved by tapping into the post_limits filter.

Step 1: Add the ‘my_post_limit’ Function

The my_post_limit function is what the post_limits filter will use to update the standard loop query.

We’ll use the function to use paging and offsets together. This function should be placed in your theme’s functions.php file.


function my_post_limit($limit) {
	global $paged, $myOffset;
	if (empty($paged)) {
			$paged = 1;
	}
	$postperpage = intval(get_option('posts_per_page'));
	$pgstrt = ((intval($paged) -1) * $postperpage) + $myOffset . ', ';
	$limit = 'LIMIT '.$pgstrt.$postperpage;
	return $limit;
} //end function my_post_limit

Step 2: Add the Filter Reference


<?php add_filter('post_limits', 'my_post_limit'); ?>
<div id="recent">
<h3>Recent Articles</h3>

In the above code, I add a filter for post_limits, which will call the my_post_limit function mentioned in Step 1.

Step 3: Start Your Loop

In this loop, we’ll be declaring a global variable called $myOffset. This will be the offset we’d like to have and is used by the my_post_limit function.


<ul>
<?php
global $myOffset;
$myOffset = 1;
$temp = $wp_query;
$wp_query= null;
$wp_query = new WP_Query();
$wp_query->query('offset='.$myOffset.'&showposts=5'.'&paged='.$paged);
?>
<?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
        <li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>

Step 4: Enable Navigation

We’re just adding the standard next/previous links at the end of the loop.


<div class="navigation">
  <div class="alignleft"><?php previous_posts_link('&laquo; Previous') ?></div>
  <div class="alignright"><?php next_posts_link('More &raquo;') ?></div>
</div>
</div>

Step 5: Remove the Filter

In this step, we’ll be removing the post_limits filter and assigning the query back to its original value thanks to a temporary placeholder.


<?php $wp_query = null; $wp_query = $temp;?>
<?php remove_filter('post_limits', 'my_post_limit'); ?>

Step 6: You’re done!

Using the above code, you should now be able to use offsets and paging together.

Here is a downloadable file of all the code mentioned in this post.

Thank you John for asking such a great question.

Tags:

6/18/2008 ↓

WordPress Theme Release for 6/18 12comments

One Column Themes

WP Pix

wp-pix-thumbnail

WP Pix is a one column theme with no sidebars. The theme can be use by photo bloggers. The theme comes in with two different page templates one for displaying a blog and another for displaying portfolios.

Two Column Themes

Happy Cyclope

 happy-cyclope-thumbnail

Happy Cyclope is a 2 column widget-ready theme. The theme is easy-to-customize, and displays the category pages and archives as lists.

Big Brain

big-brain-thumbnail

Big Brain is a two column widget-ready theme. As the name suggests there is image of big brain in the header. The theme also uses bigger fonts for post titles and content.

Ndomche Summary

ndomche-thumbnail

Ndomche Summary is a two column theme. The theme has a grid based style and has only been tested with WordPress 2.5 and above.

Aurora

aurora-thumbnail

Aurora is a two column widget-ready colors. The theme makes use of dark colors.

Elegant

elegant-thumbnail

Elegant is a pleasant looking two column theme. The theme is widget-ready and is made up of different flavors of the blue color.

Tags:

$3500+ purse for WordPress Plugin Competition 12comments

. . . and growing! We have had a couple of really large (Thanks to Matt and Automattic for their generous contributions towards the competition) and some smaller donations towards the final set of prizes for the plugin competition with the total purse standing at over $3500 dollars. Thanks to everyone who has donated money and time towards the competition to help make it a success. The community really appreciates your involvement. We continue to look for donations and sponsors to make the pot sweeter.

This is your chance to not only showcase your work to the WordPress community but to also win fabulous cash prizes. If you are planning on releasing a plugin for the competition, head over to the plugin competition blog, register yourself and post about your plugin there. We have had a spat of registrations but the number of announcements on the blog has been much less. Please tell us about your cool new entry; our readers would love to know and help test and fine tune your plugins for you!

For those that are following the competition and looking for cool plugins to test, there already are a couple of posts on the Plugin Competition Blog to whet your appetite. Please provide your feeback for the authors. It will help them make their plugins better and your votes (on the final entries, not on the announcements) will help tremendously in the judging.

The email address to submit entries is wpplugincomp [at] wltc [dot] net Please use this email address towards the end of the competition to send in your entries into the plugin competition. You do not need to send in your entries till the last day and sending in your entries early will not give you any advantage. On the contrary, waiting till the last moment will give you more chances to tweak and modify your plugin to your benefit. Please use the contact form in the menu above to send in your questions about the competition or if you want to pledge some money towards prizes.

6/17/2008 ↓

What is the simplest WordPress blog you’ve seen? 81comments

This post is based on a question that was posted on reddit.com which really intrigued me. I have seen a lot of WordPress blogs that are so simple and so well constructed that they blew me away and inspired me to do more to make my blogs simple(r). I just have a hard time finding them when the time is right and I am about to make changes to my designs.
In that spirit, what is the simplest and most elegant WordPress design that you have come across? Lloyd’s blog comes to mind as a good example.

  • All In One SEO Lives On

    For those of you who may not have heard, it was recently discovered that the popular All In One SEO Plugin for WordPress would be no longer updated or supported past WordPress 2.5.1. The plugin is currently compatible with 2.5.1 but may not work with future versions of WordPress. However, I have managed to get a hold of the plugin author and he informed me that he believes the plugin will not die. He is currently in discussions with a number of other developers to continue maintenance of the plugin. He also expressed interest in the idea of having the plugin integrated into the core of WordPress. *UPDATE* It looks like the plugin has found a new home. A WordPress.org user who goes by the username hallsofmontezuma who is also the plugin author of the WP Security Scan plugin as well as the SMS Text Message plugin has taken over the development of the All In One SEO Plugin. The plugin can now be found on the Semper Fi Web Design website. I want to personally extend a hearty thanks to Uberdose who was the original author of the plugin. You can’t talk about WordPress and SEO without mentioning the All In One SEO Plugin. Thanks for deciding not to stop the project but instead, found a new home for it. I learned about the new plugin author via the Imbloggingthat blog. (34)

6/16/2008 ↓

WordPress Plugin Releases for 6/16 8comments

Author: Keith Dsouza Category: Wordpress Plugins

AU Footer

AU Footer plugin lets you add html code to your website footer. A footer on a website is where you typically have your copyright notice. You no longer have to update the footer template manually which is helpful for theme updates and switching themes.

My Top Commentators

My Top Commentators is a plugin that allows a blogger to discover who are the most active commentators on his blog (via the WordPress Dashboard, so other people will not see this information). You can also use different time frames for the top commentators.

Show125

A handy widget that allows you to display 125 x 125 ad banners in your sidebar. The links and images are configurable through the admin interface.

Photo Galleria

Photo Galleria plugin synchronizes Galleria with built-in media manager in Wordpress. Simply upload photos as normal and the Photo Galleria plugin will create a photo gallery with fade-in and fade-out effects common on flash-based websites.

picasaView

picasaView allows you to easily view your picasaweb albums in your blog. To achieve this, all you need to do is to insert a placeholder wherever you want to display your album in a post or page. You can also use a PHP code snippet to display the album in the sidebar.

MaxRef Widgets

MaxRef Widgets is a powerful way to add unlimited widgets on your sidebars to display posts only from a certain category, the links from a particular link category, comments and more.

Feed reading blogroll

Feed reading blogroll provides a sidebar-widget and a template-tag that add an enhanced blogroll to your sidebar. It checks on all your linked sites for which you saved a separate feed-url, when the most recent update has occurred.

Tags:

6/14/2008 ↓

The Ownership Of Comments 76comments

Author: Jeff Chandler Category: Blogging

I’ve been reading a very interesting discussion over on the IntenseDebate blog with regards to the question, Who Owns Your Comments? IntenseDebate is one of three major third party commenting systems available. The other two are Disqus and CoComment.

Before I dive into the WordPress aspect of this question, you need to know that IntenseDebate is asking this question because they are a third party commenting system. Therefor, they act as a link between the blog and the commenting system which is outside of the in-house solution provided by publishing platforms such as WordPress. Because of this fact, IntenseDebate needs to figure out how comment editing between the two will work out for the best.

However, the question IntenseDebate raised can be addressed to the realm of blogging in general. When you browse around WordPress.com or self-hosted WordPress powered blogs and leave a comment, who really owns that comment? You or the blogger? Or should there be shared ownership between the two?

A number of interesting points were made in the comments of the ID post. For instance, some users didn’t care who owned their comments just as long as they couldn’t be changed by the blog author. Others believe that because of the way U.S. copyright law works, commenter’s retain the ownership and copyright of their comments. While still others believe that a Creative Commons commenting license is in order for Blog owners to display on their site.

Where do I fall on this issue? Bloggers have had the ability to edit comments for quite some time now. I believe that editing a comment to misconstrue the original comment is morally wrong. In fact, I believe the entire issue of what bloggers do with comments after they have been posted comes down to morality. In my own experience, I have only edited a few comments due to misspelling or the posting of personal information such as phone numbers or email addresses.

I don’t believe a commenting bill of rights needs to be created in which all blogs should follow. However, I do think that each blogger should create and make publicly accessible a commenting policy. This policy should clearly explain what you as the blog author will do with comments posted on your site, who retains ownership of those comments and explain circumstances which would require you to edit an end user’s comment.

That’s what I think. Let me know what you think in the COMMENTS!

6/13/2008 ↓

  • Useful WordPress Tricks (for the Theme Designer)

    Useful WordPress Tricks: StylizedWeb has an interesting article on simple but useful WordPress functions and code tricks that can make your theme succint, short and keep it optimized. Examples are simple to understand an include code to copy and paste to try on your own. (4)

6/12/2008 ↓

WordPress Theme Releases For 6/12 21comments

Two Column Themes

Faleonis

faleonis-thumbnail

Faleonis is a two column widget-ready theme with inbuilt gravatar support WordPress 2.5 and above. The theme also shows a gravatar of the author at the end of each post.

Syrup

syrup-thumbnail

Syrup is a two-column widget-ready theme which provides users with extensive options panel to control the look and feel of the theme. You can manage custom color schemes, layouts, sidebar positioning, font sizes and more from the admin panel.

DarkClassic

darkclassic-thumbnail

DarkClassic is a two column widget-ready theme made up of black color with a green tinge. The theme has built in tag support.

Gymmetry

gymmetry-thumbnail

Gymmetry is a two column widget-ready theme. You can customize the blog title and sidebar styles along with the header of the theme. The theme can also be customized to use 4 different colors.

WP Newsmag

wp-newsmag-thumbnail

WP Newsmag is a two column widget-ready magazine style theme. The theme has slider functions for the bottom bar and featured articles.

Three Column Themes

ComicPress

comicpress-thumbnail

ComicPress is a theme made specially for blogs that publish comics, the latest edition of this theme has 5 different layouts which you can choose from. The theme also comes built in with its own manager to configure the theme and upload comics.

Tags:

WordPress.com 2.5 Essential Training Videos 6comments

WordPress.com 2.5 Essential Training at lynda.com Online Training Library® is a set of training videos by Maria Langer (who also happens to be a professional helicopter pilot) that walk through the setup and use of WordPress as a blogging tool. Sadly, the title of this set of videos might be a bit misleading (though the title does indeed say WordPress.com, I was taken by the version number in the title) since the videos are tailored for WordPress.com blogs and not for self hosted WordPress.org blogs. However, a few of the initial videos are offered for free download and the only option for purchase of the full set is via a monthly subscription for $25 which would give the user access to all the videos on lynda.com. There are plans to sell the videos as a CDROM for purchase but those are not available as of this post.

The videos are aimed towards the basics of blogging and range in topics from setting up a blog on WordPress.com to creating and maintaining posts, pages, categories, adding multimedia, choosing and setting up themes, managing users and participating in the blogosphere.

6/11/2008 ↓

Hiding Advertisements For Single Posts 28comments

Author: Keith Dsouza Category: HOW-TO, WordPress Hack

There are many plugins which are useful when it comes to displaying ads to your visitors but there are only a few of them which allow you to determine to whom and when you should. Who Sees Ads does help you to determine to whom and when you should display advertisements, though, there is a limitation with the plugin as it does not allow you to control the ads shown on single post level.

In this post we will talk about the quick and easy way to hide advertisements for any particular post by making some minor changes to your theme.

The Condition To Skip Advertisements For Single Posts

Talking about conditions whatever you do there is always a condition under which you perform any action. We will use a similar logic and create conditions under which the advertisements should not be displayed for certain posts.

The condition we will be using is quite simple and will fulfill the following statement, ” if something happens do this otherwise do something else”.

This can be simplified into lay terms as “if you are hungry buy a burger” “else don’t buy a burger”. As you can see the conditions you apply are quite simple and pertain to you to doing some kind of activity under different conditions.

The Code To Skip Advertisements In Single Posts

To skip advertisements for single posts you will have to manually edit the file “single.php” of your current WordPress theme. I recommend you edit your theme through the WordPress Admin Panel since it will help you catch any errors and save you a lot of trouble.

Once you have opened the single.php navigate to the place where you have placed the advertisements and change the code within the WordPress Loop from;

…………

Your Advertisement Code

…………

to;

if(get_the_ID() != xx) {

…………

Your Advertisement Code

…………

}

Replace xx with the post id for the post which you do not want to show advertisements for. You can also skip multiple posts from displaying advertisements by adding the OR condition in the following way;

if(get_the_ID() != xx || get_the_ID() != xx) {

…………

Your Advertisement Code

…………

}

For those who are unaware of programming “||” represents OR in programming language and if you are curious AND is represented by “&&”.

How do you get the IDs of the posts you want to Skip Advertisements for?

To find the IDs for the posts you want to skip advertisements for, you will need to login to your WordPress administration panel and navigate to the Manage option. Once there find the post you want to skip the advertisement for and hover over it, you should see the ID of the post in your status bar. Check the screenshot below;

find-post-id

If you do not see the id in the status bar you can find out the ID by clicking on the post and going into edit mode where you will see the ID for the post in the URL.

find-post-id-address-bar

Once you make the changes to your advertisements they will not display for the posts you chose to skip.

If you do have any questions feel free to ask them in the comments and I would be more than happy to answer them.

Note: This trick will not work if you use external plugins to display your ads and is only valid when you display ads by hard coding them into your themes.

Tags:

6/9/2008 ↓

WordPress Theme Releases for 6/9 8comments

One Column Themes

Jin

jin-template

Jin is a a one-column theme which allows users to add post images directly to the home page using the write post page. The theme has a extended sidebar in the footer area.

Two Column Themes

Darkzen

darkzen-thumbnail

Darkzen is a two column widget-ready theme. The theme makes use of darker colors and comes built in with social networking integration for home pages as well as single pages.

Elegant Brit

elegant-brit-thumbnail

Elegant Brit is a two column widget-ready theme. The theme allows visitors to rearrange the widgets in the sidebar as well as collapse any widgets that would not like to see. Users can store their settings for next time if cookies are enabled in the browser.

Our Rights

our-rights-thumbnail

Our Rights is a two column fixed-width widget-ready theme. The theme has in built support for Gravatars.

Three Column Themes

TechnoHolic

technoholic-thumbnail

TechnoHolic is a flexible three column theme which can also be converted into a two column theme. The theme also has a 3 column extended sidebar in the footer area.

Tags:

6/8/2008 ↓

Comment Remix - Video Plugin Review 6comments

Author: Ronald Huereca Category: Wordpress Plugins

If you cannot see, the video, please visit this link: Comment Remix - Video Plugin Review

Today’s WordPress Plugin video review is of Comment Remix.

Video Summary: Comment Remix adds numerous admin panel options, as well as reply, quote, and tag capabilities on a post. The star feature for admins (in my opinion) is the “In Need of Reply” option, as well as the various actions added to comments.

Pros: Reply/Quote options are useful for admin and end-users. “In Need of Reply” is great for blog admins and unreplied comments. A lot of admin panel options make this plugin highly configurable.

Cons: Pop-up boxes could use the built-in WP 2.5 thickbox.js script. The “In Need of Reply” badly needs an “ignore all” option. Not sure of the usefulness of tags for comments unless there are global options. Styling could also be better for the comment actions.

The Comment Remix plugin is entered in the WLTC Plugin Competition. Please head over and give your say to the Comment Remix plugin.

For a text review, please read Plugin Review - WP Comment Remix.

If you think your WordPress plugin will merit itself to a video review, please get in contact with me via e-mail (ronalfy+wltc @ gmail dot com). Please keep in mind I will not review premium plugins.

For more videos, please check out our brand new video website at Weblog Tools Videos.

Hot or Not: TypePad AntiSpam 11comments

I received a ping from Anil on their newly released beta product TypePad AntiSpam while I was on vacation. I told Anil that I would look into it and write a balanced article on it when I got back. I procrastinated on writing the post for quite a while but that also gave me the chance to think about the product quite a bit, have some conversations with Anil and others about the product and ruminate on the merits, usefulness and finally the viability of the service. It came as no surprise to me that Six Apart would come up with such a product and the choices made for the product are even lesser of a surprise. I had some initial thoughts on branding and the nature of the product that I communicated to Anil privately but the rest of the review of the technology and the service is my opinion verbatim.

From the main page for TypePad AntiSpam, here are the salient features:

  • Free for everyone, regardless of how many comments you receive
  • Adapts to changing spam tactics
  • Retains quality comments
  • Already built in to the TypePad blogging service
  • Plugins for Movable Type 3 & 4
  • Plugins for WordPress 2.5
  • Open Source
  • 100% Akismet API compatible

The product is being tested by quite a few bloggers and has already received positive feedback for effectiveness from big names such as Michael Arrington of TechCrunch. But I hope that the initial successes are not short lived.

The plugin(s) and the core engine that runs the service are both Open Source (GPL v2) and though Six Apart is not sharing all of the rules and logic that run their implementation of the TypePad AntiSpam engine, they are willing to share the core engine code in order to facilitate others in developing similar services with their own sets of rules and logic. Worthy of note is the fact that the TypePad API is completely compatible with the Akismet API (which is incredibly simple to use, BTW) and any plugins that make use of the Akismet API, will be able to transparently use TypePad AntiSpam as well.

What is “Hot” about TypePad AntiSpam?

  • It is Open Source: The API and the core engine being OSS provides a lot more flexibility and gives developers a lot of insight into the product. Innovations are the likely result.
  • It is free: Free is always good, but can have its shortcomings.
  • Simple API: Kudos for building interoperability into the service. We have a common enemy.
  • Written in Perl: I am not a Perl snob but have written enough OO Perl to know the benefits. Akismet fought with language barriers and scalability for quite a while.
  • Extensible: Developers can write plugins for the service that will provide added functionality, rules and logic that could make the service better and more versatile.

What is “or Not” about TypePad AntiSpam?

  • The Engine is Open Source: This poses a serious set of problems for the Spam Mitigation service providers. Akismet can keep spammers guessing because a select few people know how it really works. The rules and logic are not the only secrets but the whole ball of wax is closed to prying eyes.
    It might become easier for spammers to figure out ways around the TypePad AntiSpam service and they could start tainting information to suit their purposes. OSS in this case can be a double edged sword.
  • We might see in spammers posing as anti spam services just like we have anti virus and anti spyware services mushrooming over the web.
  • While a well funded corporation can keep up with the scalability needs of floods of Ham Vs Spam, smaller services will find it hard to manage and still be effective. Free anti spam services can easily die under the load and reduce trust amongst users.
  • Too many sites offering the same service will water down the effectiveness of the intelligent rules that depend on real spam data to target spam. Akismet, GMail and other services that rely on their users’ feedback to fine tune their Spam targets, depend on the large amount of positive and negative re-enforcement to increase their effectiveness. Though this is speculation on my part, my understanding of intelligent, knowledge based systems is the reason behind this guess.
  • Though the engine is Open Source, there seems to be no plans to incorporate advances developed by end users directly into the codebase. This might change with adoption and maturity of the product but at first glance, it seems to be lacking foresight.
  • Since their API is compatible with Akismet (which is a good thing), this might encourage plugin developers to try and overlap spam services in order to increase the effectiveness of their anti spam plugins. However, doubling up on spam checking will not only increase comment posting latency, it could potentially make their plugins less potent in recognizing spam.

TypePad AntiSpam is a step in the right direction. Six Apart is providing tools to fight a common enemy and is offering up the tools with the right attitude. Some of their choices are suspect in my eyes as more competition for Akismet and Automattic than in support of their real belief in community service and benevolence. Nonetheless, it is a step in the right direction and they should be applauded for their efforts. I sure hope that the weaknesses that they have built into their product does not reduce its effectiveness in the long run and they can help the blogging community reduce the scourge of Spam.

Tags:

WordPress Plugin Competition Prizes 7comments

The WordPress Plugin Competition is in full swing. A lot of people have expressed interest in participating in the competition and some prizes have already been committed. As in the years past, the plugin competition prizes will be listed on the prize page. But here is a short list of what is in store for the winners.

  • Weblog Tools Collection is offering up $1000 of prize money for the winners
  • James and Andrew from Incsub have offered up $250 for a plugin that is WPMU compatible. They add that WPMU plugins are not that dissimilar to regular plugins, but need to run automatically and efficiently via wp-content/mu-plugins and require users to make no hard code changes (just edits in Settings) and for global administration to be possible via the Site Admin menu.
  • Geof F. Morris has generously offered $100 towards the competition
  • WindowsObserver.com has provided a copy of Tom Clancy’s Rainbow Six Vegas for the PC and a copy of Enemy Territory: Quake Wars
  • OIOPublisher has provided four copies of their advertising plugin for the winners
  • Will you help?

We are still looking for more donations to add to the plugin competition coffers. If you have benefited from the plugin competition in the past, want to promote WordPress plugin development and proliferation or would like to help us out in recognizing and celebrating WordPress plugin authors, please consider donating a few bucks. Your support will go a long way and every dollar will be used as prize money for the winners.

We are also looking for sponsors of the plugin competition. A lot of people view the competition, help choose the winners and then download and benefit from the plugins developed for the competition. The benefits of sponsoring the competition are two fold, especially if you are directly involved with WordPress. Not only will your company or product receive exposure from the sponsorship, you will also help in promoting plugin development and can help provide the extra incentive to plugin authors and help them develop fantastic plugins such as WordPress Automatic Upgrade and Who Sees Ads which were both winners in the last plugin competition.

6/7/2008 ↓

Plugin Deactivation Issues Solved With Actions and Filters 8comments

When Jeff wrote about plugin deactivation breaking your blog, Aaron and I wrote in the comments of a few solutions to prevent plugin issues with themes.

Within this post I will present several techniques plugin and theme authors can take in order to prevent deactivation issues.

Method 1: function_exists

In this example, let’s assume we have a function named related_posts.

When in a theme, we could use this code to call the function if only it exists.


<?php if (function_exists("related_posts")) {  related_posts(); } ?>

The PHP function_exists checks for the existence of the function, and if it does exist, it calls the function.

Method 2: function_exists and Actions

Using the same function name, the theme author could add some code into their functions.php file and use an action and function_exists combination.


if (function_exists('related_posts')) {
	add_action('my_related_posts', 'related_posts');
}

In the above example, we create a new action called my_related_posts.

The end user would use the do_action function where he wants the function used:


<?php do_action('my_related_posts'); ?>

Method 3: Actions

To use pure actions, the plugin author would have to take the initiative and add associated actions to their plugin code.

The code would look very similar to method 2, but would be included in the plugin file.


add_action('my_related_posts', 'related_posts');

The end user would then do the simple do_action call.


<?php do_action('my_related_posts'); ?>

Method 4: function_exists and Filters

Say, for example, there’s a plugin with a template tag that returns some code that you can then echo out in a theme.

Let’s pretend for a minute that the related_posts function could return a string instead of automatically spitting out the code to the screen.

In this case, the template author could add some code into their functions.php file.


if (function_exists('related_posts')) {
	add_filter('my_related_posts', 'related_posts');
}

The end user would then add the following to their theme:


<?php $s =  apply_filters('my_related_posts'); echo $s; ?>

Method 5: Filters

Again, the plugin author would have to take the initiative to only use filters. The plugin author would add the following to their code.


add_filter('my_related_posts', 'related_posts', 1, 2);

The above filter has a priority of one and accepts two arguments.

The end user (aka, theme tweaker), would add very similar code as used in method 4.


<?php $s =  apply_filters('my_related_posts', 4,10); echo $s; ?>

Method 6: Actions and do_action_ref_array

Let’s assume the plugin author has added in the appropriate code to their plugin:


add_action('my_related_posts', 'related_posts', 1, 1);

The above related_posts action just adds an action at priority one, which accepts one argument.

The themer could then add a reference to this action using the do_action_ref_array function.


<?php do_action_ref_array('my_related_posts', array(3,20)); ?>

Assuming the my_related_posts action takes two arguments, we use an array to pass the necessary arguments.

Conclusion

As mentioned in the introduction, it’s the plugin or theme author’s responsibility of adding in the necessary actions and filters so that the end user can deactivate plugins without any major headaches.

The methods I mentioned are not exhaustive, and can be far more advanced if need be. If you have any questions, please leave a comment.

For any code, please use Pastebin and provide a link.

Tags:

6/6/2008 ↓

WordPress Theme Release for 6/6 13comments

Two Column Themes

ClearPixels

clearpixels-thumbnail

ClearPixels is a widget-ready theme fully compatible with WordPress 2.5. Native Gravatar (2.5+) and tagging support. Also has an optional "sitewide announcement" configurable via a theme options page.

iPhonized

iphonized-thumbnail

iPhonized is a two column widget-ready theme. The theme supports custom fields. The titles and comment counts are surrounded by rounded corners. The comments are embedded inside speech boxes.

Spotlight

spotlight-thumbnail

Spotlight is a free WordPress theme with 3 widgetized areas in the sidebar (top, left, right) along with native Gravatar (2.5+) and tag support.

Three Column Themes

Mag Essentials

mag-essentials-thumbnail

Mag Essentials is three column widget-ready theme. The theme has a wide sidebar and has space for banner ad integration. The theme has a magazine style Design.

Pundit

pundit-thumbnail

Pundit is a three column widget-ready theme designed to focus on the writing. Perfect for news or political blogs or for anyone who anyone who wants to keep it simple.

WP Platinum

wp-platinum-thumbnail

WP Platinum is a 3 column widget-ready theme specifically created for Firefox. The theme has a featured article section.

Tags:

Calling all Plugin Authors 10comments

We’re one month into the plugin competition, so I thought I should write in and ask you how plugin development is going on?

Are you ready with a plugin?
If so, then it is time to create an entry on the Plugin Competition Blog. If you do not have author access then create an account and contact us to upgrade your account. Don’t forget to mention the plugin page on your site.

Are you still hunting for ideas?
Take a look at a post I made a while back.

Need some questions answered?
Ask away :)

Looking to sponsor the competition or donate some prize money?
Please contact us. Donating money is easy and quick and it helps out the WordPress community.

Remember we have just another month to go before the end of the plugin competition.

6/4/2008 ↓

WordPress Plugin Releases for 6/4 9comments

Author: Keith Dsouza Category: Wordpress Plugins

is_human()

is_human() is the simplest yet most extensive human verification system available on the WordPress market. Users can choose one of three verification types, or have the script show one at random on each page-load.

WP Comment Remix

WP Comment Remix allows you to reply and quote links for commentators and also provides a full upgrade to the edit comments pages in the admin panel.

WP-Help

WP Help is a plugin that allows you to create a simple help or instructional page in the Wordpress Admin that will display customized information of your choosing.

Image Upload HTTP Error Fix

Fixes the media uploader HTTP Error that some WordPress (2.5+) configurations suffer from.

Photo Galleria

Photo Galleria is a simple, yet elegant, plugin for photographers, designers and Wordpress 2.5 users alike who want to beautify their Wordpress photo galleries using the jquery framework.

WP Movie Ratings

WP Movie Ratings is a wordpress plugin that makes rating movies very easy. At its core is a bookmarklet, which combined with Internet Movie Database (imdb.com) and a little bit of AJAX magic lets you rate movies with just 1 click.

Widgetized Admin Dashboard

Widgetized Admin Dashboard is a Wordpress Plugin for 2.5+ that lets you edit the Wordpress Dashboard in the Design > Widgets area.

Tags:
Translate to German Translate to Spanish Translate to French Translate to Italian Translate to Portuguese Translate to Japanese Translate to Korean Translate to Russian Translate to Chinese

Latest WordPress Jobs

Latest Videos


S2