Canonical post about Genesis Post Info and Post Meta

Genesis uses the terms post info and post meta to describe the post byline (usually appearing under the post title) and the post categories and tags (usually appearing in the post footer).

I always get these muddled up, hence the need for this canonical post about them.

Post Info (Entry Header)

Filter the contents of post info using the following code. The default output is shown, shortcodes can be swapped from info to meta or vice versa.

<?php
add_filter( 'genesis_post_info', __NAMESPACE__ . '\\post_info_filter' );
/**
* Filter the post info.
*
* @return string
*/
function post_info_filter() {
return '[post_date] by [post_author_posts_link] [post_comments] [post_edit]';
}
view raw gistfile1.txt hosted with ❤ by GitHub

Post Meta (Entry Footer)

Filter the contents of post meta using the following. The default output is shown, shortcodes can be swapped from info to meta or vice versa.

<?php
add_filter( 'genesis_post_meta', __NAMESPACE__ . '\\post_meta_filter' );
/**
* Filter the post meta.
*
* @return string
*/
function post_meta_filter() {
return '[post_categories] [post_tags]';
}
view raw functions.php hosted with ❤ by GitHub

Reader Interactions

Comments

  1. Hi Craig,

    Your blog posts are great and very helpful.

    For this one, I think the parameter is missing.
    function post_info_filter($post_info) {}
    function post_info_filter($post_meta) {}

    Your thoughts?

  2. Hi Thomas, in both cases, you would only need to pass in the parameter if you wanted to modify and return that same parameter (maybe after using a str_replace() or something like that). Because I’m returning an entirely different $post_info/ $post_meta I don’t need to pass in the function parameter (the original).

Leave a Reply

Your email address will not be published. Required fields are marked *