
Bootstrap 3 Loop Layout
This is a wordpress loop, wrapped in some Bootstrap 3 Grid Layout
Snippet options
Download: Download snippet as bootstrap-3-loop-layout.php.
Copy snippet: For this you need a free my code stock.com account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!
<?php if(have_posts() ) : ?> <?php while ( have_posts() ) : the_post(); ?> <?php // Title Abfrage ?> <?php if(is_front_page() || is_page() ) : ?> <div class="row row-title"> <div class="title col-xs-12 col-sm-12 col-md-12 col-lg-12"> <h2><?php the_title(); ?></h2> </div> </div> <?php else: ?> <div class="row row-title row-date"> <div class="title col-xs-12 col-sm-9 col-md-9 col-lg-9"> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> </div> <div class="date col-xs-12 col-sm-3 col-md-3 col-lg-3"> <h3><?php the_date(); ?></h3> </div> </div> <div class="row row-categories"> <div class="category col-xs-12 col-sm-12 col-md-12 col-lg-12"> <p><?php _e('Category', 'YOURTEXTDOMAIN'); ?>: <?php the_category("<span class=\"cat-seperator\">/</span>"); ?></p> </div> </div> <?php endif; ?> <?php // Frontpage und Page nur "content", Rest zeigt alles ?> <?php if(is_front_page() || is_page() || is_single() ) : ?> <div class="row row-content"> <div class="content col-xs-12 col-sm-12 col-md-12 col-lg-12"> <?php the_content(); ?> </div> </div> <?php else : ?> <div class="row row-excerpt row-thumbnail"> <div class="thumbnail-preview col-xs-12 col-md-4 col-sm-4 col-lg-4"> <a href="<?php the_permalink(); ?>" class="preview-image-link"> <span class="zoomer"><i class="fa fa-search"></i></span> <?php // Thumbnail und Post Auszug if(has_post_thumbnail() ) { the_post_thumbnail('thumbnail'); } ?> </a> </div> <div class="excerpt col-xs-12 col-md-8 col-sm-8 col-lg-8"> <?php the_excerpt(); ?> </div> </div> <div class="row row-tags"> <div class="tags col-xs-12 col-sm-12 col-md-12 col-lg-12"> <span class="tag-base"><?php _e('Tags', 'YOURTEXTDOMAIN') ?>:</span><?php the_tags('<ul class="tag-list"><li><span class="label label-default">','</li><li><span class="label label-default">','</li></ul>'); ?> </div> </div> <div class="row row-comments row-read-more"> <div class="comments col-xs-12 col-sm-6 col-md-6 col-lg-6"> <p><?php $num_comments = get_comments_number(); // get_comments_number returns only a numeric value if ( comments_open() ) { if ( $num_comments == 0 ) { $comments = _e('0 Comments', 'reifengundlach'); } elseif ( $num_comments > 1 ) { $comments = _e($num_comments . ' Comments', 'YOURTEXTDOMAIN'); } else { $comments = _e('1 Comment', 'YOURTEXTDOMAIN'); } } else { $write_comments = _e('Comments closed', 'YOURTEXTDOMAIN'); } ?></p> </div> <div class="read-more-link col-xs-12 col-sm-6 col-md-6 col-lg-6"> <a href="<?php the_permalink(); ?>" class="read-more"><i class="fa fa-angle-double-right"></i><?php _e('read more', 'YOURTEXTDOMAIN'); ?></a> </div> </div> <?php endif; ?> <?php wp_link_pages('before=<div class="row"><div class="paginations col-xs-12 col-sm-12 col-md-12 col-lg-12 text-center"><div id="page-links">&after=</div></div></div>'); ?> <?php endwhile; ?> <?php endif; ?> <?php if ( comments_open() || get_comments_number() ) { comments_template(); } ?>
Create a free my code stock.com account now.
my code stok.com is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!
Find out more and register nowYou can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.