Offset doesn't work for "new WP_Query_Multisite"?
-
Hello, I don′t know, why offset doesn’t work in my code. Can you help me with solution? Thanks ??
<? $args = array( 'posts_per_page' => 10, 'orderby' => 'post_date', 'order' => 'DESC', 'post_type' => 'post', 'post_status' => 'publish', 'offset' => 4, 'sites' => array( 'sites__in' => array( 1, 2, 3, 4, 5 ) ) ); $query = new WP_Query_Multisite( $args); while ( $query->have_posts() ) : $query->the_post(); ${'blog_url_'.$blog_key} = get_blog_option($blog_key,'siteurl'); $blog_odkaz = ${'blog_url_'.$blog_key} ; //Blog URL in Czech $image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' ); $imageURL = str_replace( 'https://sportzine.eu', $blog_odkaz, $image[0] ); $imageTag = '<img src="' . $imageURL . '" alt="" height="125" width="200">'; ?> <a href="<?php the_permalink(); ?>"><?php echo $imageTag ?></a> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <? restore_current_blog(); endwhile; wp_reset_postdata(); ?>
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Offset doesn't work for "new WP_Query_Multisite"?’ is closed to new replies.