rss search

next page next page close

My First WordPress Plugin! [Comment Replacement]

Last night someone posted a profane comment and I was forced to replace that comment with a warning that the comment has been removed for so and so reasons.

A friend (Awais Karim) then commented asking whether I modified that original comment or was it a feature of the blog? With an empty stomach and a lot of time for Iftar, an idea of automating this process with the help of a WP plugin rushed through my mind. And believe me, without knowing much of PHP, I actually DID manage to create this plugin (within fifteen minutes) which I am proud to announce :D

So what does the plugin do? An array of unwanted words is maintained in a list. If the comment contains any of those words, the WHOLE comment is replaced by text of the webmaster’s choice.

For example, the list contains the following words: shit, sex, bitch

Someone comments: shoaib akhtar is a son of a bitch

Comment that appears on site: Shut Up!!

It’s not very intelligent, but hey I made it myself!!! A very useful video tutorial of making your own plugins is here.

I will put it up tonight (after eating something!!) together with a guide of how to use it.

BTW, I don’t know if such plugin is already available. Also, I haven’t named it yet [abhi abhi paida hua hai] so all suggestions are welcome!


next page next page close

Blog Revamped

After some 12 highly caffeinated nights and a similar number of slothful days, I’ve finally managed to tweak and modify the theme by Michael Jubel, to suit my needs and replace the older one (also by the same guy). To play around with the theme’s code, I backed up my entire blog on my computer, which in itself was a useful experience. Now, I don’t fear losing any data of mine because of the scheduled back up files that arrive in my mailbox. I never feared losing data before either, until I read about its importance recently. The main advantage of having an exact copy of the blog running locally is that the users don’t get to see the mess you create while adding or deleting a piece of code unadvertently. Plus, the time of development and testing phase reduces markedly as the local copy is running without the need of Internet, which btw, is an added advantage if your service provider’s electricity supply is not synchronised with yours (as is the case with me).

WordPress themes are freely available in abundance all over the web. Its a matter of choice and almost every kind is available without sparing a penny. But as with all free stuff, there is a certain limitation to it. Thankfully, the open nature provides us with enough opportunities to alter the themes according to out needs.

I liked the previous theme alot. Not only was it simple and elegant, it had a nice way of presenting the content. Unfortunately, the simplicity it had on the user-end wasn’t the case at the admin side. In fact, it was a pain! I did manage to hang on to it for some time, modifying this current new theme in that period. This theme is going to stay for a longer period of time (I think!).

Each time I attempt to tinker with the WordPress code, I marvel at the easiness of the code. The hard work behind the whole platform is well evident.

The current changes in the blog is not limited to theme. The title has been changed as well to go with my current activities. There was a plugin which allowed users to reply to comments. It was given to me by SAWJ, and has been removed on his professional advise. A new plugin, which allows users to subscribe to comments has been added instead.

Ohh..and the new favicon too. It came with the theme, but I did tweak it a little as well.

Furthermore, on certain requests, I have encrypted certain albums in the photos section with passwords.

One thing that hasn’t changed is the focus on politics. This will anger at least one person for sure, but I assure him that time will change soon :)

I sincerely hope that the new design will be liked by the regular visitors. In case you don’t like it, please don’t say so!


next page next page close

How To Make Trackback Links Visible in WordPress

The usefulness of trackbacks in WordPress is widely knows and so I’m not going to ramble about it. The objective here is to share the php function that can add “Trackback URL” anywhere in your post. Some themes are not pre-installed with it. Adding this function will result in trackback links appearing in all of your posts so that your readers can use them easily. The position of the text (of the link) is, of course, at your discretion.

In your wordpress go to the theme editor section and select the single-post file, which is to be appended with a small chunk of code. Please make sure that you have a back-up of your file before making any changes.

In the single-post(.php) file, add the following line of code at the place where you wish the link to the trackback URL to appear on your posts.

<a href=”<?php trackback_url() ?>” rel=”trackback” title=”Trackback URL<?php trackback_url(); ?>”>Trackback URL</a>

Save the file and you’re done!


next page next page close

WordPress Permalinks On Sub-domain

I always looked at those “pretty permalinks” with envy because I wasn’t able to configure my blog to use them. When my blog was located in the root directory (public_html) I had no problems with them. But, since moving on to the subdomain (blog.anasimtiaz.com) I used to get those 404 errors and so I thought probably it wasn’t easy to set them up for a novice like me.

But, I tried that again today. On the Permalinks Options page, a very small note, You should update your .htaccess now, appeared. I never noticed that before. How the heck would I update my .htacess?

By chance, I scrolled to the bottom of the page. Bewildered and stupefied. The mystery was solved.


next page next page close

Blogging by e-mail in WordPress – Tutorial

Blogging by e-mail is a convenient feature in WordPress that allows you (and others, if you wish) to post on your blog just like sending an e-mail to any address. When set up, you can simply send an e-mail to a predefined address from where WordPress picks up the mail and posts it in the assigned category. This means you can even use your handhelds or cell phones to post on the WordPress weblogs without having to browse through the web pages.

Setting up the feature is fairly easy. The gist of the procedure is that you create an e-mail account specifically to be used for this purpose (so that your personal e-mails don’t end up as your blog posts), provide that address, password and mail server in the Admin panel. The next step is to run the wp-mail.php in your WP folder which picks up the e-mail and posts it on the blog. This last step took some time for me to comprehend. There can be numerous ways to do this:

The following graphical tutorial (each step is followed by a screenshot) guides you through the complete process of setting up and activating the blog by e-mail feature in WordPress:

(more…)


next page

My First WordPress Plugin! [Comment Replacement]

Last night someone posted a profane comment and I was forced to replace that comment with...
article post

Blog Revamped

After some 12 highly caffeinated nights and a similar number of slothful days, I’ve...
article post

How To Make Trackback Links Visible in WordPress

The usefulness of trackbacks in WordPress is widely knows and so I’m not going to...
article post

WordPress Permalinks On Sub-domain

I always looked at those “pretty permalinks” with envy because I wasn’t...
article post

Blogging by e-mail in WordPress – Tutorial

Blogging by e-mail is a convenient feature in WordPress that allows you (and others, if...
article post