mirror of
https://github.com/10h30/display-featured-image-genesis.git
synced 2026-07-15 20:43:19 +09:00
change singular title output to have html5 markup
This commit is contained in:
@@ -33,6 +33,7 @@ class Display_Featured_Image_Genesis_Output {
|
||||
|
||||
add_action( 'wp_enqueue_scripts', array( $this, 'load_scripts' ) );
|
||||
add_filter( 'body_class', array( $this, 'add_body_class' ) );
|
||||
add_filter( 'genesis_attr_entry-title', array( $this, 'filter_entry_title' ) );
|
||||
|
||||
}
|
||||
|
||||
@@ -161,7 +162,14 @@ class Display_Featured_Image_Genesis_Output {
|
||||
elseif ( ! $keep_titles ) {
|
||||
|
||||
if ( ! empty( $item->title ) && ! is_front_page() ) {
|
||||
echo '<h1 class="entry-title featured-image-overlay">' . $item->title . '</h1>';
|
||||
|
||||
if ( is_singular() ) {
|
||||
genesis_do_post_title();
|
||||
}
|
||||
else {
|
||||
echo '<h1 class="entry-title featured-image-overlay">' . $item->title . '</h1>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
remove_action( 'genesis_before_loop', 'genesis_do_cpt_archive_title_description' );
|
||||
@@ -216,4 +224,16 @@ class Display_Featured_Image_Genesis_Output {
|
||||
|
||||
}
|
||||
|
||||
public function filter_entry_title( $attributes ) {
|
||||
|
||||
$displaysetting = get_option( 'displayfeaturedimagegenesis' );
|
||||
$keep_titles = $displaysetting['keep_titles'];
|
||||
|
||||
if ( ! $keep_titles && is_singular() ) {
|
||||
$attributes['class'] = 'entry-title featured-image-overlay';
|
||||
}
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user