Query shows posts when logged in, but not when logged out
-
Posts in query only shows when logged inn. I have tried to reset permalink, but still not working. This is my code:
<section class="cards"> <div class="entry-content card"> <?php $query = new WP_Query( 'pagename=yrkesfartoy' ); // The Loop if ( $query->have_posts() ) { while ( $query->have_posts() ) { $query->the_post(); the_post_thumbnail(); echo '<h2 class="section-title">' . get_the_title() . '</h2>'; echo '<div class="entry-content">'; the_excerpt(); echo '</div>'; } } /* Restore original Post Data */ wp_reset_postdata(); ?> </div> <div class="entry-content card"> <?php $query = new WP_Query( 'pagename=fritidsbat' ); // The Loop if ( $query->have_posts() ) { while ( $query->have_posts() ) { $query->the_post(); the_post_thumbnail(); echo '<h2 class="section-title">' . get_the_title() . '</h2>'; echo '<div class="entry-content">'; the_excerpt(); echo '</div>'; } } /* Restore original Post Data */ wp_reset_postdata(); ?> </div> </section><!-- #cards -->
The page I need help with: [log in to see the link]
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Query shows posts when logged in, but not when logged out’ is closed to new replies.