Archive for the ‘WordPress’ Category

Weblog Tools Collection – Bullshitters Extraordinaires

Monday, January 25th, 2010

Weblog Tools Collection - Bullshitters Extraordinaires

If you have any of your blogs powered by WordPress then you are more or less familiar with the website called Weblog Tools Collection. Weblog Tools Collection is painstakingly forced in the face of each WordPress user through RSS feeds implemented into the admin’s interface. While those are editable, most average users would not know how to go about it to get rid of Weblog Tools Collection RSS feed and many of those who have required expertise simply don’t have time to deal with it and just put up with it. After years of WordPress use and concurrent exposure to Weblog Tools Collection through admin interface I’ve followed articles posted by this website and if I were to sum them up in a single word, I’d use “useless”. Information value, or just about any value provided by mindless ramblings of Weblog Tools Collection contributors is virtually non existent. You have nothing to take from it and after reading any of their articles you never feel like you have learned something valuable. It’s always a pile of senseless crap that does nothing but feed egos of people behind this worthless website.

Besides lacking value, Weblog Tools Collection contributors and admins are five star bullshitters extraordinaires. Devil would wear down six pairs of boots to find bullshitter extraordinaires of comparable qualities. In recent article written by Mark Ghosh titled “Are You Spamming Comments Inadvertently?” Weblog Tools Collection once again demonstrates that they don’t put money where their mouth is. The article talks about importance of comments and how Weblog Tools Collection values quality comments and how they reward quality commenters blah blah blah. The only trick is that anyone who’s ever commented on Weblog Tools Collection articles and didn’t deliver an ass kissing charade saw their comment marked as spam, deleted or modified (at minimum by having the URL removed). Hypocrisy of Weblog Tools Collection admins knows no limits in this regard. As a result, comments found on Weblog Tools Collection are of as low quality as articles themselves. Because the only way to get guaranteed approval of your comment is to post something like this:

Oh yeah, I totally agree with you. I could have never said it better. You are a God for bringing this up…

It is undisputable that Weblog Tools Collection admins are in it to feed their own egos and when their egos are hurt, they deal with it by utilizing their admin privileges. All that on a blog that’s forced into every WordPress user’s face. And then after all is said and done, Mark Ghosh has the nerve to come up and post an article about how the community is important to them and preach about proper commenting etiquette. Bullshitters extraprdinaires who perfected the art of bullshitting right there. Their biased, ego feeding comment censorship would be fine in my books if it wasn’t accompanied by hypocritical preaching on how commenting and comment moderating should be done.

 

How to Exclude Category Posts in WordPress – Tutorial with Code that Works

Saturday, July 4th, 2009

It is astounding how much worthless advice can be found on the web. If you are not a seasoned coder, you can find yourself facing simple dilemmas which can turn into a nightmare if solutions offered on various websites don’t lead to actual solution of your problem, only cause more problems and frustration. And that’s what I found to be the case with excluding posts from one particular category (or more categories) from your WordPress powered blog’s main page. I have been contacted by several people asking me for help excluding category posts from their WordPress blog, each of which was tearing their hair out as their tried many suggested solutions you can find across the web, but they either don’t work at all, or exclude the category, but break something else (mostly bust your title tags which are the most important part of your on page SEO).

Why Exclude Categories in WordPress?

There are several reasons why you may need to exclude category posts from your WordPress blog. One of the WP blogs I have built used a “Video of the Day” feature. The blog normally focused on different subject matter, but the owner wanted to offer his readers an extra feature to keep them entertained so he introduced the Video of the Day page. He would be posting one cool video each day and had them all listed on a dedicated page, however he didn’t want these Video of the Day posts mixed up with main topic of his website. So he was looking for a code to add to the WordPress theme which would exclude all posts from Video of the Day category from his main blog page. It turned up being a pain in the neck finding out the tutorial or ready to use code that would safely and reliably exclude that category.

How to Exclude Category Posts in WordPress – Tutorial

To exclude posts from a particular category in WordPress you first need to create that category and then mark down the category ID. It is very easy to do, just follow these steps:

  • go into Posts > Categories
  • create New Category (skip this step if you are excluding a category which already exists)
  • click on Category you want to exclude
  • mark down the ID number of the category – you can see it by taking a look at the ULR of the page in your browser’s address bar. It is the number at the end of the URL, right after the equal sign. The URL should end with something like this &cat_ID=xx where xx is a number (note, it could be a single, double or triple digit number, depending on how many categories your WordPress blog has. Some blogs could get four or five digit number. Just mark down the number in full as it appears after the equal sign)
  • go into Appearance > Editor and click on the file called “Theme Functions” (functions.php) listed under the Templates on the right hand side
  • paste the code below into your functions.php theme file, right before “?>” part at the end of it, replace “xx” with your category ID you have made note of and click “Update File”.

Code to Exclude Category Posts in WordPress

Use this code to paste in your functions.php file. It should be pasted right before the ?> part which should be the part of the exiting code. Replace “xx” in the code provided with Category ID you have made note of before hand. This is absolutely essential as you must let WordPress know which category you want to exclude for it to work. If you forget about it and paste it as it is provided below with xx instead of a Category ID, your category poses will NOT be excluded! Make sure you keep the minus sign (-), only replace “xx”, nothing more.

function exclude_category($query) {
if ( $query->is_home ) {
$query->set('cat', '-xx');
}
return $query;
}
add_filter('pre_get_posts', 'exclude_category');

Excluding Multiple Categories in WordPress

Sometimes you may wish to exclude more than one category from your main blog page. To do it is again very easy, you just need the Category ID of each category you wish to exclude. Post that Category ID along with the minus sign right before it in the same space as other category IDs, but separate them with spaces. So the final code would look something like this:

$query->set('cat', '-9 -53 -98 -484');

An example of code above would exclude posts from categories with following IDs: 9, 53, 98, 484

How to Exclude Categories from Archive Pages in WordPress

Sometimes you may also want to exclude category posts from archive pages. Or you may wish to have a category excluded from both Archives and Main Blog Page. Both of these are easy. The code for it would be as follows:

To exclude category posts from Archive pages, replace second line of code with following code:

if ( $query->is_archive ) {

To exclude category posts from both Archive pages and Main Blog Page, replace second line of code with following code:

if ( $query->is_home || $query->is_archive) {

That’s it. I have written this post in a way so even a new blogger could understand it and hopefully it helps. These codes definitely work with WordPress 2.7 through 2.8 but will also work on most older versions of WordPress.

 

Video Tutorial – How To Build a High Traffic Blog

Friday, July 3rd, 2009

Check out this video tutorial with great tips on how to build a high traffic blog without killing yourself. That “killing yourself” part is the most interesting one. With millions upon millions of bloggers out there busting their nut to capture a reader, blogging is a highly competitive venture. So how does one build a high traffic blog without killing oneself? You will be able to find many answers and great tips in the video tutorial above.

The video is 50 minute long and features a presentation speech by Tim Ferriss, owner of The 4-Hour Workweek blog and an author of the best selling book with the same title. The video tutorial covers a wide range of topics, including frequency of blog posts, through use of blogging tools all the way to building a community. It’s well worth the watch, it can teach you a lot and definitely serves as great inspiration tool.

For your information, this video tutorial was recorded at the WordCamp San Francisco, which is an event put together by the WordPress community.