Answer the question
In order to leave comments, you need to log in
How to customize the display of posts in wordpress for different screen resolutions?
Good afternoon! On the main page in one of the headings it is set to display 3 posts. The output of posts for this category is carried out through a loop:
<div class="row">
<?php query_posts('cat=2&orderby=date&order=DESC&posts_per_page=3');?>
<?php if(have_posts()):while(have_posts()): the_post();?>
<div class="col-md-4 col-sm-6">
<div class="content_post">
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php get_template_part( 'content', get_post_format() ); ?>
</div>
</div>
</div>
<?php endwhile; endif;?>
</div>
<?php wp_reset_postdata();?>
Answer the question
In order to leave comments, you need to log in
<div class="row">
<?php query_posts('cat=2&orderby=date&order=DESC&posts_per_page=3'); ?>
<?php if(have_posts()): $i = 0; while(have_posts()): the_post(); ?>
<div class="col-md-4 col-sm-6 <?php echo ($i % 3 == 0) ? 'hidden-sm' : ' '; ?>">
<div class="content_post">
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php get_template_part( 'content', get_post_format() ); ?>
</div>
</div>
</div>
<?php $i++; endwhile; endif; ?>
</div>
<?php wp_reset_postdata(); ?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question