Answers for "get posts by multiple categories via slug"

0

get posts by multiple categories via slug

<?php $args1 = array( 'posts_per_page' => 6, 'offset'=> 0, 'category' => array(2,3,25,30));
            $myposts1 = get_posts( $args1 );
            foreach ( $myposts1 as $post ) : setup_postdata( $post ); ?>
            <div class="each-post col-lg-aynk col-md-aynk col-sm-aynk col-xs-aynk">
                <a href="<?php the_permalink(); ?>">
                    <h2><?php the_title(); ?></h2>
                </a>
                <a href="<?php the_permalink(); ?>">
                    <div class="news-story-img">
                        <?php if (class_exists('MultiPostThumbnails')) : MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'secondary-image'); endif; ?>
                        <?php the_post_thumbnail( get_permalink() ); ?>
                    </div>
                </a>

            </div>

            <?php endforeach; 
            wp_reset_postdata();?>
Posted by: Guest on September-20-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language