‘WordPress Hack’ Category

WordPress Hacks: 21 tips to make you smile

14
responses
by
on
August 28th, 2008
in
WordPress, WordPress Hack

Well there are two links that showcase 11 and 10 fixes and hacks respectively. Most Desired WordPress Hacks: 11 Common Requests and Fixes: Noupe lists 11 commonly requested WordPress hacks and elegant fixes for them. They include avoiding duplicate content, having category specific menus, sidebar login boxes, most wanted categories etc. 10 WordPress Hacks to make Your Life Easy: Jai lists another 10 hacks to play with. His hack tutorials include adding gravatars to comments, Twitter, image gallery, author bio etc. Some of these are just tutorials on how features work within WordPress and how to incorporate them into existing themes while others are all our modifications of code in themes and in various other places. None of them look too difficult and some of them can be accomplished with plugins. However, all of them are worth checking out.

[Continue Reading...]

WordPress Tips for 7/27

14
responses

Image alignment within a WordPress post: WordPress 2.5 introduced floating image alignment within text on a post. This feature does not work on certain themes. Thanks to Jason for asking the question and to Sadish for the solution. Final thought: it would also be nice if a few gallery formatting options were available through the default interface instead of having to modify the shortcode and/or introduce hacks. WordPress Search as a custom Google Search without addition page or post: Add a custom Google Search to your WordPress blog (and make search advertising dollars?) without too much of a hassle. Complete instructions and examples are included in the post. Create a Flash Arcade site using WordPress: This set of instructions will help you convert a simple WordPress blog into a Flash arcade site. Pretty cool with detailed instructions on the transition. Here is a tip which I stumbled upon accidentally, that […]

[Continue Reading...]

WordPress for iPhone App

16
responses

WordPress for iPhone: Big news from the Automattic team yesterday. They released a first look at their iPhone App that works on both WordPress.com and WordPress.org blogs. The application is Open Source, available from the iPhone App store and will be available for free. The screen real estate problem with the large on screen keyboard looks to be largely solved with this app and it adds the ability to modify previous posts and view your blog on the web. The official iPhone app for WordPress blog is linked above. The application received rave reviews from a variety of sources such as TechCrunch and Webware and ma.tt talked about it yesterday. Check out the screencast when you get a chance. It definitely has a wow factor.

[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...]

Plugin Deactivation Issues Solved With Actions and Filters

12
responses

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 […]

[Continue Reading...]

Removing Width/Height from the Image Uploader

33
responses

Reader Vivien writes in: Is there a way to prevent WordPress from inserting the width and the height for images in the new 2.5 media manager? In short, yes, but it requires you to insert some code into your theme’s functions.php file. Fortunately, there is a WordPress filter we can use called image_downsize, which takes in three arguments (a boolean, an attachment ID, and a size string). add_filter('image_downsize', 'my_image_downsize',1,3); All I’m doing in the above filter is setting the filter name, the function to call (my_image_downsize), what priority I want the filter, and how many arguments the function takes. From there, I mimic the function image_downsize in the ‘wp-includes/media.php’ file, but do not return a width or a height. As a result, when the image is sent to the editor, no width or height is present. function my_image_downsize($value = false,$id = 0, $size = "medium") { if ( !wp_attachment_is_image($id) ) […]

[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...]

Exporting-Importing A Category

23
responses

When it comes to exporting, WordPress already does a wonderful job with it’s support to export posts, pages, comments, custom fields, categories, and tags. However, there is a problem. The WordPress exporter lacks granularity. What I mean by this is that, the exporter covers the entire blog instead of being able to select certain categories to export. I’ve searched the WordPress Plugin database high and low to look for a plugin that would specifically export categories and I could not find one. I did manage to come across two techniques though that get the job done. There are two ways to export specific categories. The first is to read this forum post where HandySolo explains how to use the category RSS feed to export specific categories from a self hosted blog to a WordPress.com blog. The problem with this method is that, none of the meta data attached to the […]

[Continue Reading...]



Obviously Powered by WordPress. © 2003-2013

css.php