Fatal error WP_Query
-
Hello,
I put this simple code in a snippet.
I get an error that blocks the whole site. I can’t log in to the dashboard.
I need to log into the database and disable the database snippet.
Where is it wrong?
=================
$args = array(
‘post_type’ => ‘post’,
);
$the_query = new WP_Query( $args );// The Loop
if ( $the_query->have_posts() ) {
echo ‘- ‘;
- ‘ . get_the_title() . ‘
while ( $the_query->have_posts() ) {
$the_query->the_post();
echo ‘‘;
}
echo ‘‘;
} else {
echo ‘<h1>no posts found</h1>’;
}
/* Restore original Post Data */
wp_reset_postdata();
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Fatal error WP_Query’ is closed to new replies.