Can anyone tell me what I’m doing wrong here. I keep getting an empty inside-article div before or after main content when trying to hook to the said places.
Here is my code;
<?php
if (ICL_LANGUAGE_CODE == "sv") {
$cat = 'swe';
} else {
$cat = 'casinos';
}
$args = array(
'category_name' => $cat,
'posts_per_page' => -1
);
// The Query
$the_query = new WP_Query( $args );
// The Loop
if ( $the_query->have_posts() ) {
while ( $the_query->have_posts() ) {
$the_query->the_post();
get_template_part( 'content', 'page', get_post_format() );
}
wp_reset_postdata();
}
?>