Removing Author Details from Posts in WooThemes

Under each post in a WooThemes theme, is a box that provides details of the author. Some sites, especially business sites that just want to publish their own news items from time to time, do not want the author details appearing. So how do you remove it from a WooTheme?

One method would be to override the templates and remove it. However, every time you override a template, you are storing up problems for a future theme update, as your custom template and the core Woo template get further out of step. Instead, there are hooks that can be used.

Jumping straight in, this code, added to your child theme’s functions.php, will remove the author block from below each post:

add_action(
    'wp_head',
    function() {
        remove_action( 'woo_post_inside_after', 'woo_author_box', 10);
    },
    20
);

If you are using PHP 5.2, you may need a more traditional approach:

function woo_author_custom() {
    remove_action( 'woo_post_inside_after', 'woo_author_box', 10 );
}
add_action( 'wp_head', 'woo_author_custom', 20 );

The first uses the an anonymous function and the second a named function, but they essentially do the same thing.

In the wp_head action, WooThemes registers woo_author_box() in its woo_post_inside_after action at priority 10. We just need to remove woo_author_box() from that same action, and do it at priority 20 of the wp_head hook, to make sure we remove it *after* it was added.

And that’s it. Have fun.

One Response to Removing Author Details from Posts in WooThemes

  1. Josh 2015-08-07 at 05:58 #

    There is actually a much easier way to remove the author’s details – and it’s built right within the Canvas theme options. This article explains it: http://geektamin.com/blog/630/how-to-remove-the-author-name-in-wordpress-canvas-theme/

Leave a Reply