How to Customize the Post Meta Function

You may notice that the Genesis Framework outputs a line just below post’s content. This is called the Post Meta. By default, it is comprised of the categories and tags that the post has been assigned. There are two ways you can customize this function.

Option #1 – Genesis Simple Hooks Plugin

We have developed a plugin that will enable you to customize the Post Meta function from your WordPress dashboard. The Simple Hooks plugin was developed to extend the capabilities of Genesis and allow you to hook HTML, PHP and shortcodes to any of the existing hooks within the framework.

Option #2 – Using Custom Filter in Your Child Theme’s Functions File

To remove the post meta function, open your child theme’s functions.php file, enter this code:

/** Remove the post meta function */
remove_action( 'genesis_after_post_content', 'genesis_post_meta' );

To customize the post meta function, open your child theme’s functions.php file, enter this code:

/** Customize the post meta function */
add_filter( 'genesis_post_meta', 'post_meta_filter' );
function post_meta_filter($post_meta) {
if (!is_page()) {
    $post_meta = '[post_categories] [post_tags]';
    return $post_meta;
}}

The code above will replace the default output from the Genesis parent theme, allowing you to customize it as you wish from the child theme’s functions.php file. The section of the filter above that can be edited to suit your specific needs is as follows, highlighted in RED.

$post_meta = 'Place Custom Post Meta Shortcodes and Content Here';

For a comprehensive list of shortcodes and attributes, check out the Shortcode Reference page.