Skip to content

Instantly share code, notes, and snippets.

@studiograsshopper
Created January 2, 2012 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save studiograsshopper/1551199 to your computer and use it in GitHub Desktop.
Save studiograsshopper/1551199 to your computer and use it in GitHub Desktop.
Genesis - modify main loop title only
<?php
add_filter( 'genesis_post_title_text', 'child_modify_title' );
/**
* Add price to post title when category is 'current stock'
*
* This will only show the price on "main loop"
*
* @param string $title, post title text, as per genesis_do_post_title()
* @return string $title, modified title
*/
function child_modify_title( $title ) {
if( in_category( 'shop-news' ) ) {
global $post;
$price = get_post_meta( $post->ID, 'Prijs', true );
$title = $title . ' ~ &euro;' . $price;
}
return $title;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment