Saturday 29 June 2013

Customize Genesis Post Info

If you want to customize genesis post info, then you will need few code snippets. Actually it depends on your need and accordingly you can modify it.

Genesis is extremely flexible and powerful wordpress theme framework. And that's the reason why its so easy to modify or customize any element of your website.

Post info is the post information block which shows the number of comments, date on which it was published, author name and also the byline. By default it is placed below the title area, but you can easily reposition genesis post info with simple hooks and you can even add conditional filters.

How To Customize Genesis Post Info


Well before we proceed I will suggest to take some precautionary measures. Actually we are going to edit function.php file. This file is responsible for all custom functions performed by your themes and if you placed the code in wrong position it will temporary bring down your website.

So please kindly;
  • Create complete backup of your theme.
  • Make sure you have direct access to your file manager.
  • You can use FTP tool or,
  • Login to your cPanel and keep your file manager open.

Now once you complete the above task, you can move to your wordpress dashboard. From there you will have to put your cursor on Appearance and then from hover on menu select editor.

Wordpress dashboard >> Apperance >> Editor

Now from editor select the function.php file. Now simply copy the required code from below and paste it at the bottom.


//* Customize Post Info In Genesis Theme
add_filter( 'genesis_post_info', 'post_info_filter' );
function post_info_filter($post_info) {
$post_info = '[post_date] by [post_author_posts_link] [post_edit]';
return $post_info;
}

Now if you are planning to remove post info then you can use the below code.

remove_action( 'genesis_before_post_content', 'genesis_post_info' );
You have to just copy them and paste them into your function file. Once done, clock on Update button and you are ready to go.

1 comments:

  1. Cool. What if you wanted to move the post info (author byline, date and leave a comment link), not title, below the post content?

    ReplyDelete