Archive for the 'word press' Category

Tuesday
22 Jun 2004
6:23 pm

Weekday plugin

Well … it looks like I’ve created another plugin today. I’m on a roll … G-LOL

Anyways, this one is a plugin that will add the weekday next to the date …

  • If the post was posted today, it will put “Today”.
  • If the post was posted yesterday, it will put “Yesterday”.
  • Otherwise it will put the actual weekday (i.e. Tuesday).

I had done this in MT and wanted to use it here too. Took a little more finagling than it did in MT because of the way that WP does the date. But it’s done. If you’d like to do this on your blog too, you can get the plugin here.

And to use this, replace …

<?php the_date(); ?>

with …

<?php weekday_date(); ?>

I’ve only got posts from today in my blog so far, so I can’t test this beyond that. So … if you have any problems or questions, please let me know.

Last Updated on: 23 Jun 04 at 12:56pm
Plugin file: weekday.php
Other needed files: none

:: EDIT - 23 Jun 04 9:15am :: There appears to be an issue with this plugin. It doesn’t display “Yesterday” like it is supposed to. I will work on it and post the updated code.

:: EDIT - 23 Jun 04 9:25am :: Took me only 10 minutes to figure out that one (actually less ‘cuz I fixed some other stuff). I’ve updated the code and it should work now.

:: EDIT - 23 Jun 04 12:24pm :: Looks like another issue has cropped up with this plugin. I’ve got it working correctly for “Today” and “Yesterday”, but other than that, it’s just putting either “Wednesday” or “Thursday”. I will be working on it this afternoon to resolve this issue. Please be patient with me. This is one of my first attempts at a plugin. I never said it was fool proof.

:: EDIT - 23 Jun 04 12:56pm :: Okay I think I have things working now. I was thinking too hard trying to fix it. The solution was easier than I thought. The plugin has been updated. Download and try the new code and let me know if it works.

Mood: workingworking
Posted under word press | 13 Comments (13) ... RSS
Tuesday
22 Jun 2004
4:35 pm

Trackback popup plugin

Well … looks like I’ve created my first, very own plugin for WordPress. The base install of WP gives you the option to have a comments popup. I was doing that on my MT blog, and wanted to do that here as well. Well, the default comments popup page showed both the trackbacks and the comments. THAT I didn’t want.

Well, in order to get ONLY the comments to show up on the comment popup page, I used the code that Scriptygoddess had for separating the trackbacks and comments on the wp-comments.php page.

That gave me what I wanted for the comments popup page, but how was I going to go about getting the trackback popup page? Well, I modified the code for the comments popup and created a plugin for it. You can download my plugin here. (I don’t think there was one already made. I couldn’t find anything like it.)

Now I needed a wp-trackback-popup.php file. Well, I modified the wp-comments-popup.php file and got this.

In order to get this to work, I put the following in the header …

<?php trackback_popup_script(); ?>

Then, I put the following in the index.php file where I wanted the popup to show up (this was inside of THE LOOP).

<?php trackback_popup_link('Trackbacks (0)', 'Trackbacks (1)', 'Trackbacks(%)'); ?>

It’s working fine for me so far. If you try this out and have any problems, please let me know. And if this post is too confusing, let me know, and I’ll try to explain things better.

If you do end up using this, let me know. I’m curious if anyone else wanted something like this.

Last Updated on: 25 Jun 04 at 1:21pm
Plugin file: trackback_popup.php
Other needed files: wp-trackback-popup.php - put this in the root directory

:: EDIT 25 Jun 04 11:42am :: The plugin has been updated to give the correct number of trackbacks AND pingbacks. Prior to this, it didn’t count the pingbacks. I changed the MySQL query, and it should now give the correct number.

:: EDIT 25 Jun 04 1:21pm :: This should now give the correct number of pingbacks and trackbacks. I had to add an extra function to my plugin. It worked in my testing. If you still have trouble with this, please let me know.

Mood: accomplishedaccomplished
Posted under word press | 14 Comments (14) ... RSS