Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for excerpt and thumbnails inside header tags #1495

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions single.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
array(
'prev_text' => '<span class="nav-subtitle">' . esc_html__( 'Previous:', '_s' ) . '</span> <span class="nav-title">%title</span>',
'next_text' => '<span class="nav-subtitle">' . esc_html__( 'Next:', '_s' ) . '</span> <span class="nav-title">%title</span>',
'in_same_term' => true,
)
);

Expand Down
3 changes: 2 additions & 1 deletion template-parts/content-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
<?php _s_post_thumbnail(); ?>
</header><!-- .entry-header -->

<?php _s_post_thumbnail(); ?>


<div class="entry-content">
<?php
Expand Down
4 changes: 2 additions & 2 deletions template-parts/content-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
?>
</div><!-- .entry-meta -->
<?php endif; ?>

<?php _s_post_thumbnail(); ?>
</header><!-- .entry-header -->

<?php _s_post_thumbnail(); ?>

<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
Expand Down
36 changes: 20 additions & 16 deletions template-parts/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,30 @@
?>
</div><!-- .entry-meta -->
<?php endif; ?>

<?php _s_post_thumbnail(); ?>
</header><!-- .entry-header -->

<?php _s_post_thumbnail(); ?>

<div class="entry-content">
<?php
the_content(
sprintf(
wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers */
__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', '_s' ),
array(
'span' => array(
'class' => array(),
),
)
),
wp_kses_post( get_the_title() )
)
);
if ( !is_singular() && has_excerpt() ) :
the_excerpt();
else :
the_content(
sprintf(
wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers */
__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', '_s' ),
array(
'span' => array(
'class' => array(),
),
)
),
wp_kses_post( get_the_title() )
)
);
endif;

wp_link_pages(
array(
Expand Down