Automatically wrap post image in div

It’s the image_send_to_editor filter: if(is_admin()){ add_filter(‘image_send_to_editor’, ‘wrap_my_div’, 10, 8); function wrap_my_div($html, $id, $caption, $title, $align, $url, $size, $alt){ return ‘<div class=”mydiv” id=”mydiv-‘.$id.'”>’.$html.'</div>’; } } For existing images/posts you can try the regex in the function below

WordPress in “Couch Mode”?

Here’s a method to achieve what you want internally without adding anything to the .htaccess file. It works by adding a rewrite endpoint named read, so any single post permalink with read appended to the end will have a different single post template applied. For example, if your normal single post permalink is: localhost/techylab/some-post-title/ The … Read more

Any Hook Called When Post Becomes Published?

Every time a post changes status, wp_transition_post_status function will be called. This triggers the actions ${old_status}_to_${new_status} and ${new_status}_${post->post_type}, so for example publish_post will be triggered here. A post with a date in the future will have the status future until it is actually published, so this should work for you.

Post format selector in Thematic child theme post class

Okay, I’m going on the assumption that the real question is “how do I get Thematic to add the post-format to its body classes?” Try this in your functions.php: function my_thematic_post_format_class( $classes = array() ) { $format = get_post_format(); if ( ” == $format ) $format=”standard”; $classes[] = ‘format-‘ . $format; return $classes; } add_filter( … Read more

Getting rid of the #038; when string replacing content

&#38; is essentially synonym of &amp;. In the_title filter wptexturize() runs with priority 1 (important!) and makes this replacement. So by the time it gets to your format_title() at priority 11 – instead of replacing lone & symbol you replace (and break) chunk of &#38; character entity. So you can: move your function to priority … Read more

Pagination Help on Crazy Custom Authors Page

I doubt you’re going to be able to repurpose WP-PageNavi for this, since you’re not using the built-in queries at all. You should be able to roll pagination yourself, though, and still fall back on some of WordPress’s built-in functionality. In particular, if your URL matches the pattern /meet-the-team/page/3/, the paged querystring variable will automatically … Read more