PHP

WordPress Admin Icons Template

WordPress Admin Icons Template

Matthias Kretschmann has developed a template for designing your own icons for the admin area of WordPress. This is very useful for plugin and theme developers looking to add new icons to their new menus. Icons are also used when you have custom post types on your blog.

Advertisements

Dynamic JavaScript with PHP

Early this morning, I released Top 10 – A Page Counter and Popular Posts plugin for WordPress. I detailed my experience while designing this plugin. The major problem that I faced while working with this plugin was with WP Super Cache. WP Super Cache creates a static file of your post and displays this to the viewer. As a result, any PHP code that is present in your WordPress blog template is executed only once and the cached file is then served to your visitor.

The initial version of Top 10 used PHP to record the page views as well as display them and so using WP Super Cache ensured that both of these would never increment.

This is where JavaScript with PHP comes in. I ended up using AJAX to record the page views. However, for displaying the count I chose to do so by serving the PHP file as a JavaScript file.

Here’s how you go about it.

Read More »Dynamic JavaScript with PHP