How to wrap every image in a post with a div?

By default images already have unique class’s but this depends on your theme. Use firebug and hover over the images and you should see stuff like class=”aligncenter size-full wp-image-1525″. If you want to change the class or id or alter any attributes of the image you can use the get_image_tag filter. For example, add_filter(‘get_image_tag_class’,’my_custom_class’); function … Read more

How to list the Hooks and order of execution in current loading page? [duplicate]

Paste this into your functions.php //LIST ALL HOOKS function dump_hook( $tag, $hook ) { ksort($hook); echo “<pre>>>>>>\t$tag<br>”; foreach( $hook as $priority => $functions ) { echo $priority; foreach( $functions as $function ) if( $function[‘function’] != ‘list_hook_details’ ) { echo “\t”; if( is_string( $function[‘function’] ) ) echo $function[‘function’]; elseif( is_string( $function[‘function’][0] ) ) echo $function[‘function’][0] . … Read more

display featured image in RSS feed

function add_featured_image_url($output) { global $post; if ( has_post_thumbnail( $post->ID ) ){ $output = wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) ) . ‘ ‘ . $output; } return $output; } add_filter(‘the_excerpt_rss’, ‘add_featured_image_url’); add_filter(‘the_content_feed’, ‘add_featured_image_url’);

Broken pagination

I see a few issues that are probably contributing to your issue: Only ever use query_posts() to modify the primary Loop. The caller_get_posts parameter has been deprecated, in favor of ignore_sticky_posts The $wp_query variable is a defined global. Using it outside of its intended use may cause unintended circumstances. So, first, you need to determine … Read more

Custom comment type maybe?

I also (ab?)use comments for “private” replies to posts, like product inquiries, suggestions, answers to contests, … The advantage is that they are stored in the database and displayed in the interface without extra code from me (sometimes I add a filter to improve the formatting). Spam filtering and e-mail notifications are easy extras. I … Read more