Main loop works on local not on live.
-
Greetings,
I have a site where my main loop is not picking up any posts at all while my headline loop works fine. I´ve used wp_Query and reset the query before the main loop. On my localhost the theme works but once live I´m not getting anything other than the headline. I´ve been using the underscore theme but frankly I´m stumped. Any help appreciated<div id="headline"> <?php /* Headline Query */ $query2 = new WP_Query( 'post_type=headline' ); while ( $query2->have_posts() ) { $query2->the_post(); get_template_part( 'template-parts/content', get_post_format() ); } // Restore original Post Data wp_reset_postdata(); ?> </div> </main><!-- END #main --> <div id="subpages"> <?php if ( have_posts() ) : ?> <?php if ( is_home() && ! is_front_page() ) : ?> <header> <h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1> </header> <?php endif; ?> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php /* * Include the Post-Format-specific template for the content. * If you want to override this in a child theme, then include a file * called content-___.php (where ___ is the Post Format name) and that will be used instead. */ get_template_part( 'template-parts/content', get_post_format() ); ?> <?php endwhile; ?> <?php the_posts_navigation(); ?> <?php else : ?> <?php get_template_part( 'template-parts/content', 'none' ); ?> <?php endif; ?> </div><!-- #subpages -->
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Main loop works on local not on live.’ is closed to new replies.