Link Entry-Title to Custom Meta Data in Post List Grid
-
I’d like to make the entry-tile linkable on my post lists.
This is the code I am using to make it link to meta-data found in the post:
add_filter('tc_grid_display_figcaption_content' , 'tc_grid_set_expanded_post_title'); function tc_grid_set_expanded_post_title( $_html ){ if ( ! $this -> tc_force_current_post_expansion() ) return $_html; global $post; $_title = apply_filters( 'tc_grid_expanded_title' , $post->post_title ); $_title = apply_filters( 'tc_the_title' , $_title ); $_title = apply_filters( 'tc_grid_expanded_title_html'; $linkvalue = get_post_meta($post->ID, 'affiliate_link', true); if($linkvalue) { sprintf('<h2 class="entry-title"><a href="' . $linkvalue . '" rel="bookmark">%1$s</a></h2>', $_title ) ); } else { sprintf('<h2 class="entry-title">%1$s</h2>', $_title ) ); } return $_html . $_title; }
It doesn’t work. ??
- The topic ‘Link Entry-Title to Custom Meta Data in Post List Grid’ is closed to new replies.