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

Populate a drop down list with post titles across a multisite network

You should be able to replace this section: $posts = get_posts( ‘numberposts=-1&post_status=publish&post_type=questionnaire’ ); $choices = array(); $choices[] = array(“text” => “Select Questionnaire”, “value” => “”); foreach ( $posts as $post ) { $choices[] = array( ‘text’ => $post->post_title, ‘value’ => $post->post_title ); } // update ‘Select a Post’ to whatever you’d like the instructive option … Read more

Get posts from category from custom query

I figured it out. Here is my solution <?php $categories = get_the_category(); $category_id = $categories[0]->cat_ID; $mymain_query = new WP_Query( array( ‘cat’ => $category_id,’posts_per_page’ => ’10’ ) ); while($mymain_query->have_posts()) : $mymain_query->the_post(); ?> //shortened code below <div class=”blog-post”> <h5><?php the_title(); ?></h5> <p><?php the_content(): ?></p> </div> <?php endwhile; ?> <?php wp_reset_postdata(); // reset the query ?>