Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="blog-section">
- <div id="blog-wrap">
- <?php
- $choice = get_field( 'fp_show_blogs' );
- if( $choice = 'yes' ) {
- global $wp_query;
- $args = array(
- // 'post_type' => 'post',
- 'posts_per_page' => 6,
- );
- $p_query = new WP_Query( $args );
- if ( $p_query->have_posts() ) :
- $i = 0;
- echo "<ul>";
- while ( $p_query->have_posts() ) : $p_query->the_post();
- // $i++;
- // $pclass = 'one-half';
- // if ( $i % 2 == 0 ) {
- // $pclass .= ' first';
- // }
- ?>
- <li class="one-half <?php if ( ( $i % 2 ) == 0 ) { echo 'first"'; } else { echo '"'; }?>">
- <a href="<?php echo the_permalink(); ?>" title="<?php echo the_title(); ?>"><h2><?php echo the_title(); ?></h2></a>
- </li>
- <?php $i++;
- endwhile;
- echo "</ul>";
- endif;
- } else {
- echo "No Blogs to show!";
- }
- ?>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement