Removing .svn folders recursively

The easiest way I have found is to open the Terminal and remove a listing of the folders:

cd /Users/YourUserName/TheFolderWhereSVNFilesAre
rm -rf `find . -type d -name .svn`

NOTE: Make sure that you user the grave accent quote (located on the left of the number 1 key)

Getting the post thumbnail URL

You can use wp_get_attachment_image_src() to retrieve an object with the post thumbnail information.

include ('wp-blog-header.php');
$post_id = $_REQUEST['id'];
$img_id = get_post_thumbnail_id($post_id, $size = 'post-thumbnail', $attr = '' );
$image = wp_get_attachment_image_src( $img_id );

While methods such as get_the_post_thumbnail() returns an image tag (), wp_get_attachment_image_src() returns a numeric array with the thumbnail info:

  • $image[0] => url
  • $image[1] => width
  • $image[2] => height

You can also determine if a post has attachments by calling has_post_thumbnail(), which returns a Boolean (true or false)

Getting pages by meta_key value

The following example shows how to query posts that have a custom filed name color and the assigned value is red.

$red_pages  = query_posts('post_type=page&meta_key=color&meta_value=red&orderby=menu_order&order=ASC');

Get page children

The following example requests pages whose parent is ID 123. By specifying depth as 1 we can make sure only inmediata children will be return. A list of all pages can be obtained if depth is set as zero (0).

$params = array(
$pages = query_posts($params);
print_r($pages, 'ARRAY_A');