Browsing archives for 'One Liner'

WordPress One Liner to Remove Style Tags from Posts using [gallery] Shortcode

Code, One Liner, PHP, Snippet, Wordpress 26 February 2009 4 Comments

One of the biggest things that irritates me when using the [gallery] shortcode is that style tags are inserted into the post content. Why does this irritate me? Because this does not validate as XHTML 1.0. Luckily the fix is quite easy. Add the following code as a plugin or to[...]

WordPress One Liner to Customize Author Permalink

Code, One Liner, PHP, Snippet, Wordpress 23 December 2008 6 Comments

Several people have asked me recently how to customize the author permalink from being /author/admin to something like /profile/admin. I have created a simple one line piece of code that you can drop in your themes functions.php to achieve this.
add_filter(‘init’, create_function(‘$a’, ‘global $wp_rewrite; $wp_rewrite->author_base = "profile"; $wp_rewrite->flush_rules();’));
Drop this into your themes functions.php wrapped in[...]