Created
May 10, 2017 05:08
-
-
Save 3h5a9/afb49aca1ae111c290d972229ec43c0a to your computer and use it in GitHub Desktop.
Warning: Invalid argument supplied for foreach() in C:\wamp64\www\wordpress\wp-content\themes\twentytwenty\tpart\content-gallery.php on line 12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<article id="post-<?php the_ID();?>" <?php post_class('t20-format-gallery'); ?>> | |
<header class="entry-header text-center"> | |
<?php if ( t20_get_attachment() ): | |
$attachments = t20_get_attachment(7); | |
?> | |
<div id="post-gallery-<?php the_ID(); ?>" class="carousel slide" data-ride="carousel"> | |
<div class="carousel-inner" role="listbox"> | |
<?php | |
$i = 0; | |
foreach ( $attachments as $attachment ): | |
$active = ( $i == 0 ? ' active' : ''); | |
?> | |
<div class="item<?php echo $active; ?> background-image standard-featured" style="background-image: url(<?php echo wp_get_attachment_url( $attachment->ID ); ?>);"> | |
</div> | |
<?php $i++; endforeach; ?> | |
</div> | |
</div> <!-- .carousel --> | |
<?php endif; ?> | |
<?php the_title('<h1 class="entry-title"><a href="'.esc_url(get_permalink()).'" rel="bookmark">', '</a></h1>' ); ?> | |
<div class="entry-meta"> | |
<?php echo posted_meta(); ?> | |
</div> | |
</header> | |
<div class="entry-content"> | |
<div class="entry-excerpt"> | |
<?php the_excerpt(); ?> | |
</div> | |
<div class="container-button text-center"> | |
<a href="<?php the_permalink(); ?>" class="btn btn-t20"> | |
<?php _e( 'Continue Reading', twentytwenty ); ?> | |
</a> | |
</div> | |
</div> <!-- .entry-content --> | |
<footer class="entry-footer"> | |
<?php echo posted_footer_meta(); ?> | |
</footer> | |
</article> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment