Archive for the ‘WP Hack’ Category

Display Sub Categories for Each Category

Wednesday, January 14th, 2009

whack

The code that I will explain here will display sub categories only when you are viewing a single category which contains sub categories. This template hack is very simple.

Place this code in your category.php file

<?php
if (is_category()) {
$this_category = get_category($cat);
if (get_category_children($this_category->cat_ID) != "") {
echo '<h2>';
single_cat_title();
echo '</h2>';
echo '<ul>';
wp_list_categories('orderby=id&hide_empty=1&show_count=0&title_li=&child_of='.$this_category->cat_ID);
echo '</ul>';
}
}
?>

Put this snippet in your category.php template file and It should show sub categories for your parent categories on category pages.

This code simply does the following:

  • Checks whether the current page is a category
  • Checks if the category is parent and has sub categories
  • If it has sub categories, it displays them with a header and unordered list

Customize the wp_list_categories() function

wp_list_categories('orderby=id&hide_empty=1&show_count=0&title_li=&child_of='.$this_category->cat_ID);

By default it displays categories by ID, hides empty categories, and does not show number of posts within each category.

The following code will show post count besides each category

wp_list_categories('orderby=id&hide_empty=1&show_count=1&title_li=&child_of='.$this_category->cat_ID);

Very easy! You can also change hide_empty=1 to hide_empty=0 to display
empty categories (even if they do not have posts, they appear!)

Source from [ http://mywordpressdesign.com/ ]

Installing Wordpress via Fantastico

Wednesday, December 10th, 2008

10 Steps to Installing Wordpress via Fantastico

There are many ways to install Wordpress but one of the easiest ways to install Wordpress is by using Fantastico. Read on for a step by step guide on installing Wordpress via Fantastico

  1. Find the Fantastico icon in your hosting control panel, for most people this is probably your cpanel. Depending on which cPanel skin you used the icon will look different. For some, it may look like a wizards hat. For others, it will look like a blue smiley face. It should be located underneath “Software/Services.”
  2. Click on the Icon and you will be taken to your Fantastico dashboard.
  3. In the sidebar you will see a list of items that you can install, click on “Wordpress.” This will bring you to your Wordpress installations overview.
  4. Click on the link that says “New Installation”, this will bring you to the installation screen.
  5. Under the heading “Installation Location”, choose the domain you want to install Wordpress on or type in which directory you want it on. Please note that the directory cant pre-exist.
  6. After step 5, fill in your desired login information under the heading “Admin Access Data.” This is where you will select your admin username and password. Make sure the password is secure, yet something you will remember.
  7. Under the heading “Base Configuration,” type in your desired nickname, and your email address. You can change these later if you want, it isn’t like you will be stuck with them. Enter your site name and description. The description is actually your tagline, and you can change anything under base configuration later.
  8. Click the button that says “Install Wordpress,” this will bring you to a screen that has the heading of “Install Wordpress (2/3).” It will tell you what your database was named and will show you the location you chose to install Wordpress on, as well as the blogs URl.
  9. Click the button that says “Finish Installation.” This will bring you to a screen that has the heading of “Install Wordpress (3/3)“. Under it, there will be two items that say somethime along the lines of “/home/hostusername/public_html/blogdirectory/wp-config.php configured
    /home/hostusername/public_html/blogdirectory/data.sql configured.” It will also give you your login details.
  10. Enjoy your Wordpress blog!

Source from : http://www.unlocktheonlineworld.com

Tricks and Hacks

Monday, December 8th, 2008

10 Useful RSS-Tricks and Hacks For WordPress

By Jean-Baptiste Jung

RSS is one of those technologies that are extremely simple yet extremely powerful. Currently, RSS is the de facto standard for blog syndication, and it is used widely in both personal and corporate settings; for example, in blogs. And because a large percentage of these blogs run on WordPress, we’ll cover in this post some (hopefully) relatively unknown but useful RSS-related tricks and hacks that will help you use RSS in a more effective way — and without unnecessary and chunky WordPress plug-ins.

Let’s take a look at 10 useful, yet rather unknown RSS-tricks for WordPress. Each section of the article presents a problem, suggests a solution and provides you with an explanation of the solution, so that you can not just solve some of your RSS-related problems but also understand what you are actually doing. Thus, you can make sure your WordPress theme remains under your control and is not bloated with some obscure source code.

Read full article

Source from: http://www.smashingmagazine.com

Emergency!

Sunday, December 7th, 2008

Specific Instructions:

  1. Unpack the zip.
  2. Upload emergency.php to the root of your WordPress install (the same directory that contains wp-config.php)
  3. Open http://www.yourdomain.com/emergency.php in your favorite browser.
  4. Follow the simple instructions.
  5. When you are done, delete emergency.php off your server. Do not leave it up for someone else to come along and use.

Download

[ Download ]

Source from http://www.village-idiot.org/