Show WordPress Child Pages Alongside Parent Page

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 …

Display All Attached Images to a WordPress Post

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. With Timthumb This is assuming that the timthumb script is in your theme’s directory: wp-content/themes/mytheme/timthumb.php <?php …

How To Make Your WordPress Post Look Nice When Shared On Facebook

How To Make Your WordPress Post Look Nice When Shared On Facebook

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 …

Allow Iframes In WordPress Posts

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 …

Timthumb and Shortcodes for Easy WordPress Images

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 …

WordPress Thumbnails Outside The Loop

Occasionally you’ll need to fetch a posts image outside of the loop. <?php $thumb = get_post_meta($post->ID,’_thumbnail_id’,false); $thumb = wp_get_attachment_image_src($thumb[0], false); $thumb = $thumb[0];?>   <img src="<?php echo $thumb; ?>" alt="" /> Combine this with the Timthumb script for control over image size. IE:   <?php $thumb = get_post_meta($post->ID,’_thumbnail_id’,false); $thumb = wp_get_attachment_image_src($thumb[0], false); $thumb = $thumb[0]; if ( has_post_thumbnail() ) { …

Embed Facebook Fan Page Photo Albums In WordPress

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 …

Remove and Prevent Revisions in WordPress

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. …

Install WordPress On a Local Server

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 …

Web Design Tricks

p5rn7vb 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

Chad Von Lind, Webcraft, Leathercraft, Bushcraft © 2013. Chad Von Lind.