Put Subtitle in Title with Link
-
Here is my original get_title code
<?php if ( is_single() ) : the_title( '<h2 class="entry-title" ' . hybrid_get_attr( 'entry-title' ) . '>', '</h2>' ); else : the_title( sprintf( '<h2 class="entry-title" ' . hybrid_get_attr( 'entry-title' ) . '><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); endif; ?>
I am trying to include the
get_the_subtitle()
orthe_subtitle()
within the actual link area of<a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a>
I did get it to display the way I want, but it is not a functional link. This is how the code looks all together, but the link does not work.
<?php if ( is_single() ) : the_title( '<h2 class="entry-title" ' . hybrid_get_attr( 'entry-title' ) . '>', '</h2>' ); else : the_title( sprintf( '<h2 class="entry-title" ' . hybrid_get_attr( 'entry-title' ) . '><a href="%s" rel="bookmark">', the_subtitle() ,'', esc_url( get_permalink() ) ), '</a></h2>' ); endif; ?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Put Subtitle in Title with Link’ is closed to new replies.