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 …
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 …
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 …
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() ) { …
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 …
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. …
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 …
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
Recent Comments