All posts in Code

Popular Post for a WordPress blog

I have been spending a little time on my blog recently, adding some useful plugins to get more movement around my pages. I’m not a huge fan of plugins, as most of them are fairly pointless, and just end up cluttering your page, and using up useful space, but the Popular Posts plugin, in my opinion, is a worth while one.

The plugin is really easy to setup. Simply download this file, rename it to .php and upload it to your plugins directory. Once you have uploaded it, you can enable it via the plugins section of your wordpress admin area, as per usual. There are a collection of things you can edit with this plugin, but I’m just going to keep it simple.

To show the popular posts on your blog, simply copy and paste the code below to where you would like to see the list of popular posts:

<?php akpc_most_popular($limit = 10); ?>

This will display the top 10 most popular posts from your blog.

Give it a bash, it’s a worthwhile one!

Ajax Loader Generator

Wow, I’m once again blown away by something I’ve found online, well actually Ruark from Guylike found it and forwarded the link to me, so the credit should go to him.

We’ve all seen these ajax websites, which have little flash like preloaders (actually just .gif file), which appear when you click on a link, so show that a event is occuring. As programmers, most of us cannot design, well I certainly know that my design skills are lacking, so when it comes to creating preloaders and moving .gif files, I prefer to subcontract someone, or find a very detailed tutorial online. Anyway, these little preloaders specifically are so very useful, when dealing with ajax, and thanks to AjaxLoad, you can now create your preloaders with an automatic generator. I gaurentee you that you don’t need any design skills to use this one!

Check it out..

STEP 1 – CHOOSE OPTIONS
ajax1.jpg

 

STEP 2 – PREVIEW & DOWNLOAD
ajax.jpg

That’s it. Nope, I’m not kiddin’! Check it out!

Scroll over rocks!

Hey peeps,

As most of you know, I love to code, and there’s nothing better than coming across something new, which isn’t too tricky to implement and adapt. A few days ago I came across Scrollovers, a fantastic little addition for your website. What is a scrollover? Hover your mouse over this! Pretty wicked if you ask me!

So let’s get onto it, how is this done?

  • Firstly you need to download this javascript file.
  • Now you need to include it in your <head></head> tags, using this code:
    • <script type=”text/javascript” src=”scrollovers.js”></script>
  • When you create a link on your website, you should now use this code:
    • <a href=”[YOUR PAGE HERE]” class=”scrollover” type=”scrollover”>[YOUR TEXT HERE]</a>

That’s it, as simple as that!

Now, you might want to make things look a little more attrative, and this can be easily done using some simple inline css code:

<style>
a.scrollover {
color: #557AFF;
}
a.scrollover em:first-line {
color: #FF5B3C;
}
</style>

There are a few more advanced features to this script, such as altering the scrolling speed, or making the scroll occur in the opposite direction, etc. If you are interested in these features, head on over the the source of this fantastic script – Scrollovers.com