Archive
Tag "Wordpress"

I recently needed some subpage code for a WordPress project. Darren Hoyt had a quick and easy solution to show the child pages of a parent page, only if the page had subpages. This was useful. My project needed to include the parent page at the top of the list of child pages, so I’ve added a small modification to it.

This goes in your page template or sidebar template where you want your submenu …

Read More

This will allow you to use Timthumb while showing all images within a WordPress post gallery. In other words, if I upload 4 photos to a post, they will automatically be shown wherever I insert this code in my template, within that post’s loop.

This is assuming that the timthumb script is in your theme’s directory: wp-content/themes/mytheme/timthumb.php

...

Read More

Have you ever wondered how your WordPress posts might look when they’re shared on Facebook?

If you’ve ever shared a link on your Facebook account, you’ve noticed the nifty Title, Image and Description that get automatically loaded to provide an attractive link. Depending on how your particular theme is built, sometimes you’ll have to cycle through several images, before the actual appropriate post image shows up with …

Read More

If you’ve ever tried adding an iframe to your WordPress post, and then switched the TinyMCE editor to Visual mode, you’ve found that the editor strips out your iframe code. This can be annoying. Just add this snippet to the functions.php file in your theme folder to prevent TinyMCE from killing your iframe.

function add_iframe($initArray) {
$initArray['extended_valid_elements'] = "iframe[id|class|title|style|align|frameborder|height|longdesc|marginheight|marginwidth|name|scrolling|src|width]";
return $initArray;
}
add_filter('tiny_mce_before_init', 'add_iframe');

Read More

Here’s a quick and easy way to update image sizes on the fly directly in your WordPress posts. Add this code into your functions.php file in your theme. Then make sure you insert timthumb.php in the root of your theme directory. Next create a fully writable directory named ‘cache’ and place that in your theme root directory.

Now inside your posts just wrap an image URL with the img shortcode. Add height, width, alt, and …

Read More

Occasionally you’ll need to fetch a posts image outside of the loop.

...

Read More

Embed Facebook Fan Page Photo Albums In WordPress

It is a great idea to have a Facebook fan page for your company, club or organization.

This is a minor hack of the Fotobook plugin (Version 3.1.8) for WordPress by Aaron Harp. Fotobook is originally meant to apply your personal photo albums into WordPress, but we’re going to make one small code tweak to instead pull the albums from the fan page that we administer.

After installing the plugin, go ahead and activate it …

Read More

I recently noticed that a particular post had built up about 10 or 15 revisions for it. I started thinking that of all the posts I have, there have to be quite a few revisions and therefore are creating a hefty sized table in my database. This was run on my WP 2.8, but should work for 2.6 and up.

Here is a solution to prevent revisions from being created, as well as removing all revisions …

Read More

In this tutorial, we’ll go through the process of setting up a server on your local computer. This will allow you to run PHP & MySQL applications, such as WordPress, directly on your machine.

As I have yet resisted joining the ranks of the Mac cult, we’ll be using PC server software. I am aware of XAMPP, WAMP, and I personally use VertrigoServ for no other reason than it is the …

Read More

Here is a round up of some very useful tricks and snippets for web designers.

Resizeable Background Image with jQuery
15 Wicked CSS Tricks
Build a jQuery Interactive Map
Better Way To Register the WP Sidebar

Read More