Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Genesis - modify main loop title only
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
You can’t perform that action at this time.