Show 5 posts and than 3 posts offset with pagination

under settings – reading, set ‘blog pages show at most’ to 8 then use conditional statements based on the current post number in the loop; <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <?php //conditionally outputting the opening tags for the first section if( $wp_query->current_post == 0 ) { ?> <div class=”posts-wrap”> … Read more

Get posts by user role in a Multisite

global $switched; switch_to_blog(2); //switched to your site id based on which site post need. $administrators = get_users( array( ‘role’ => ‘administrator’ ) ); // you can add more role on same query add with “,” separated. $administrators_ids = array(); $original_blog_id = get_current_blog_id(); foreach( $administrators as $admin ): $administrators_ids[] = $admin->ID; $news = new WP_Query( array( … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)