Archive | Wordpress hacks

Categories disappeared while upgrading to wordpress 2.6

July 21st, 2008

Apparently I’m not the only one having problems with the categories after a Wordpress 2.6 upgrade.

So, time to give something back to the Wordpress community, some screenshots on how I fixed it.

First of all, I upgraded from 2.2.3 to 2.6, it’s possible this solution will work for you, but I don’t make any promises.

I started by going to phpMyAdmin and having a look at the wp_term_taxonomy table, and noticed all the descriptions where missing.

When I took a look at the backup file I made, more specifically, the wp_categories piece, I noticed the counts and ids matched up.

I then manually edited each record, just hit the pencil icon, and filled in all my descriptions again. If you know some SQL you could do this faster, but anyway, everyone can do it manually

After I’ve done this, I visited my admin section and noticed the Descriptions were filled in again. But there was no Name, and all my posts still had empty categories linked to them.

To fix this, visit http://your-site/wp-admin/categories.php?action=edit&cat_ID=1 where 1 is the category id to edit. Fill in a Name and a Slug, the url name for your category, and save it.

Read more

Showing ads on a perticular page

April 28th, 2008

I have a wordpress based blog and i want to display adverts only on the homepage of my blog and not on the sitewide, because i want to have a control on homepage and sitewide adverts. Is this possible?
This is very much possible because wordpress files can be customised to the maximum since its one of the best CMS made ever and anyone can play around with it and great blogs. Now lets get back to the point regarding showing some type of advert or code only on the homepage and not sitewide by limited its display.

<?php if(is_home() && $post==$posts[0] && !is_paged()) { ?>
You need to add your advert code here which is shown on the homepage only.
<?php } ?>

Another option would be trying with a php code which runs a statement where in if its homepage then certain code is run if not its void.

if (is_home())
{
echo ‘is_home() returned true’;
}
else
{
echo ‘is_home() returned false’;
}

and if you are looking for the easiest way then try out this following code :

<?php if ( is_home() ) { ?>
Here the content only on the index page
<?php } ?>

This is all a part of Conditional Tags feature of wordpress which has lot more options and the ones i have posted above are the easiest of all. Hope this helps you out in adding/showing some stuff only on the index/homepage of your blog and limit them from displaying on the sitewide section.

Wordpress Blogroll hack

March 12th, 2008

Hi guys i have just discovered how important is “No-follow” attribute is for doing SEO on you website.And while doing some research on it, i came across this cool wordpress hack which i would like to share with all.So that you can take up your website high into search engines.

So enjoy optimising the website for SEO and ready to get ranked higher into search engines.Article taken from Knowledge Constructs Website.

The method I’m going to demonstrate has actually been slightly updated as the original meant losing some of the other XFN options. This version actually adds more to the existing hack and provides a new checkbox to easily add the nofollow attribute.

Here’s the quick how-to guide for WordPress newbies on how you can do this.

The file we’re going to be hacking today is:

/wp-admin/edit-link-form.php

Before we get started, BACK UP YOUR FILE.

Okay, now for step-by-step guide on the Gray Hack:

Read more


Follow me Socially

Follow me on Twitter.

Join me on Linkedln.

Join me at Facebook.

Subscribe to RSS feeds.

Subscribe to Newsletter

Quote of the day

Buddhism has the characteristics of what would be expected in a cosmic religion for the future: it transcends a personal God, avoids dogmas and theology; it covers both the natural & spiritual, and it is based on a religious sense aspiring from the experience of all things as a meaningful unity