fix: complete mobile carousel and social updates
This commit is contained in:
@@ -56,13 +56,15 @@ $wrapper = blockWrapperAttributes( $classes, $is_preview );
|
||||
<?php if ( $recent_posts->have_posts() ) : ?>
|
||||
<div class="recent-posts__grid">
|
||||
<?php
|
||||
$post_index = 0;
|
||||
while ( $recent_posts->have_posts() ) :
|
||||
$recent_posts->the_post();
|
||||
|
||||
$post_title = get_the_title();
|
||||
$post_permalink = get_permalink();
|
||||
$active_class = 0 === $post_index ? ' is-active' : '';
|
||||
?>
|
||||
<article class="recent-posts__card">
|
||||
<article class="recent-posts__card<?php echo esc_attr( $active_class ); ?>">
|
||||
<?php /* translators: %s: Post title. */ ?>
|
||||
<a class="recent-posts__image-link" href="<?php echo esc_url( $post_permalink ); ?>" aria-label="<?php echo esc_attr( sprintf( __( 'Continue reading %s', 'cwc' ), $post_title ) ); ?>">
|
||||
<?php if ( has_post_thumbnail() ) : ?>
|
||||
@@ -96,7 +98,34 @@ $wrapper = blockWrapperAttributes( $classes, $is_preview );
|
||||
</a>
|
||||
</div>
|
||||
</article>
|
||||
<?php endwhile; ?>
|
||||
<?php
|
||||
++$post_index;
|
||||
endwhile;
|
||||
?>
|
||||
|
||||
<div class="recent-posts__controls">
|
||||
<button class="recent-posts__control recent-posts__control--previous" type="button" aria-label="<?php echo esc_attr__( 'Previous article', 'cwc' ); ?>">
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
|
||||
<path d="M15 5 8 12l7 7" />
|
||||
</svg>
|
||||
</button>
|
||||
<button class="recent-posts__control recent-posts__control--next" type="button" aria-label="<?php echo esc_attr__( 'Next article', 'cwc' ); ?>">
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
|
||||
<path d="m9 5 7 7-7 7" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="recent-posts__pagination" aria-label="<?php echo esc_attr__( 'Choose an article', 'cwc' ); ?>">
|
||||
<?php for ( $dot_index = 0; $dot_index < $recent_posts->post_count; ++$dot_index ) : ?>
|
||||
<button
|
||||
class="recent-posts__dot<?php echo 0 === $dot_index ? ' is-active' : ''; ?>"
|
||||
type="button"
|
||||
aria-label="<?php echo esc_attr( sprintf( /* translators: %d: Article number. */ __( 'Show article %d', 'cwc' ), $dot_index + 1 ) ); ?>"
|
||||
<?php echo 0 === $dot_index ? ' aria-current="true"' : ''; ?>
|
||||
></button>
|
||||
<?php endfor; ?>
|
||||
</div>
|
||||
|
||||
<?php wp_reset_postdata(); ?>
|
||||
|
||||
Reference in New Issue
Block a user