Monday 1 July 2013

Reposition Genesis Breadcrumb Easily

Do you want to reposition genesis breadcrumb. Well if you are a blogger and want some unique design for your blog then you would surely like to do so.

Breadcrumbs are just like the menu links but it shows the complete link herichary. It doens't only allows helps with sitelink strutucre but also helps you readers to move to the post category or to homepage. Thus it helps to improve user attentions and your website's page-views.

Thanks to WPVKP for providing this amazing genesis code snippet.

How To Reposition Genesis Breadcrumb


First of all you need to chose the desired position at which you want to place it. Once you do so you can use Genesis visual hook guide plugin to undersand the desired loop.

For example if you want to place it before comment area then it will genesis_before_comments

But before we move any further please take these precautions.
  • Create a backup of your theme's function.php file.
  • Use FTP software and connect it with your hosting.
  • Keep your online file manager open.
Now move to your wordpress dashboard and move to Apperance and then from hover menu select Editor. You can also use cPanel code editor to make live changes.

Now copy the code posted below into your theme's function.pp file ( place it at the bottom ).

// Reposition Genesis Breadcrumbs
remove_action('genesis_before_loop', 'genesis_do_breadcrumbs');
add_action('genesis_before_comments', 'genesis_do_breadcrumbs');

Or if you want to replace it below post content block, then use this snippet. And for more of such
similar links you can visit to official Genesis hooks reference page.

// Replace Your Breadcrumbs To Desired Position
remove_action('genesis_before_loop', 'genesis_do_breadcrumbs');
add_action('genesis_after_post_content', 'genesis_do_breadcrumbs');

That's all. Once you add your snippet simply click on update and refresh your website link. You will see all your changes.

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.