‘HOW-TO’ Category

9 Ways to Make Your WordPress Blog “Smart”

150
responses
by
on
April 29th, 2009
in
HOW-TO, WordPress FAQs

Many of you might be confused by the title and the term “smart”. To me a “smart” blog is a blog that behaves differently depending on its visitors’ behavior and characteristics. A simple example of this is a blog that displays a list of today’s most popular posts on the sidebar. The list changes based on visitors’ behavior so to this is definitely a smart blog feature. There are plenty of WordPress plugins out there that do this for you automatically (e.g. Top 10), but that is not the point. The point here is that having the ability to morph your blog per visitor activity can assist you in meeting your conversion goals (whatever they may be). A list of popular posts is quite a simple feature, so let me take you to another level by showing you more ways to make your blog smart. List of “Smart” Features to […]

[Continue Reading...]

How to Highlight Search Terms with jQuery

70
responses
by
on
April 10th, 2009
in
HOW-TO, WordPress FAQs

A neat way to spice up your WordPress search page is to highlight search terms within your search results. I’ve seen some tutorials on the net on how to do this, but I haven’t found one that highlights both title and post content and is a drop-in modification for WordPress. Today I will bring you this drop-in hack for highlighting search terms on your WordPress blog. Installation 1. Copy and paste the following code into your theme’s functions.php file: function hls_set_query() { $query = attribute_escape(get_search_query()); if(strlen($query) > 0){ echo ‘ <script type=”text/javascript”> var hls_query = “‘.$query.'”; </script> ‘; } } function hls_init_jquery() { wp_enqueue_script(‘jquery’); } add_action(‘init’, ‘hls_init_jquery’); add_action(‘wp_print_scripts’, ‘hls_set_query’); If you are having issues with copy-paste from this blog, here is a link to the same code in a txt file: Code to insert into functions.php 2. Copy and paste the following code into your theme’s header.php file (just before […]

[Continue Reading...]

How to Track RSS Subscribers in a Blog Contest

45
responses
by
on
March 15th, 2009
in
HOW-TO, WordPress FAQs

Let me start off by saying that this post will not talk about how to get sponsors, how to determine prizes, or how to determine rules for a blog contest. This post will talk about how to tweak your WordPress blog to solve the biggest problem in running a blog contest to gain RSS subscribers. Problem The issue here is that there is no easy way to track if each contestant has actually subscribed to your RSS feed. Without the ability to confirm RSS subscription, anybody can just claim that they have subscribed to your feed and get a free entry into the contest. Solution A known solution to this problem is to include a special contest code into your RSS feed and not have this code visible on your website. That way each contestant will be forced to grab the code from your feed and submit the code via […]

[Continue Reading...]

Click And Drag In Plain English

4
responses
by
on
November 14th, 2008
in
HOW-TO

John Kolbert of Techlyzer has produced a great screencast explaining how to create the collapsible and movable option boxes within the WordPress 2.7 write new page/post screens. The tutorial starts off by creating a dummy plugin which you then add functions to which give it the draggable/collapsible options within the Administration panel. John provides a sample plugin to use as well as a link to the article on the Codex that explains the add_meta_box function. This tutorial is mainly for those aspiring plugin authors as well as for those who would like to add this type of functionality to their own plugin. John should rename this video to add_meta_boxes explained in plain English because even I understood and learned a thing or two. Final though is that I would absolutely love to see more screencasts like these in the future and have them embedded into their respective Codex articles. How […]

[Continue Reading...]

How to: Offsets and Paging

31
responses
by
on
June 19th, 2008
in
HOW-TO, WordPress FAQs, 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"> […]

[Continue Reading...]

Hiding Advertisements For Single Posts

39
responses
by
on
June 11th, 2008
in
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 […]

[Continue Reading...]

Create Your Own Frontpage Slideshow

17
responses

The folks over at PerfectSurf.de have published a tutorial which goes into detail on how you can create your own personal slideshow to appear on the frontpage of your WordPress powered site. This slideshow feature has been seen in numerous premium themes as of late and now you can create one for yourself via this tutorial. A slideshow is great for showcasing images within a gallery or showing off images related to top news items on your blog. The tutorial is not meant for beginners, but those of you who understand terms such as The Loop, excerpt and permalink, you should be fine. There are some caveats to this process which are outlined in the requirements: There are many ways of embedding slideshows to your website. This tutorial is based on a WordPress 2.5 installation (with some files customized and of course all files updated that were critical in WP2.5 […]

[Continue Reading...]

How To: Avoid Duplicate Posts

28
responses

A reader writes in: I’m developing a new theme and I’m having trouble getting duplicate posts from showing when running two loops (one standard loop and one from a specific category). Even when I copied the specific code from directly from the codex, it was not working. The Codex article the reader mentioned was regarding the Loop. Although the example shows how to avoid a single duplicate post, it doesn’t show how to avoid duplicating multiple posts. Here’s how to show two individual loops without duplicating posts in either loop. Step 1: Add a ‘posts_where’ Function A WordPress filter is needed to accomplish this, and we’re going to be tapping into the ‘posts_where‘ filter. The reason being is we need to modify the query used for the loop and exclude some posts. Here’s the function we’ll be using called post_strip: function post_strip($where) { global $myPosts, $wpdb; $where .= " AND […]

[Continue Reading...]

Error Management for WordPress Plugins

10
responses
by
on
May 4th, 2008
in
HOW-TO, WordPress, WordPress FAQs

For the past few weeks I’ve been working on a WordPress plugin. One of my goals was to have fancy and relevant error messages. I contemplated writing my own error manager, and even began a very basic one. I experienced hurdle after hurdle, and finally I thought to myself, “Wouldn’t WordPress have its own error manager also?” So I did a quick source-code search and came across the WP_Error class. One of the hurdles I ran into in creating my own error manager was error localization. The WP_Error class makes localizing error messages extremely simple. Adding Error Messages To add an error message, the first thing you’ll want to do is instantiate your own instance of WP_Error. $myErrors = new WP_Error(); The next step is to add in your error messages. $myErrors->add('access_denied', __('You do not have permission to do that.',$myLocalizationName)); There are a few things to notice here. There is […]

[Continue Reading...]



Obviously Powered by WordPress. © 2003-2013

css.php