function p2_title( $before = '<h2>', $after = '</h2>', $echo = true ) { if ( is_page() ) return; if ( is_single() && false === p2_the_title( '', '', false ) ) { ?> <h2 class="transparent-title"><?php the_title(); ?></h2><?php return true; } else { p2_the_title( $before, $after, $echo ); } }
function p2_title($before = '<h2>', $after = '</h2>', $returner = false) { if (is_page()) { return; } if (is_single() && p2_the_title('', '', true) == false) { ?> <h2 class="transparent_title"><?php echo the_title(); ?> </h2><?php return true; } else { p2_the_title($before, $after, $returner); } }