<?php
$categories = get_categories($arg_news);
if ($categories) {
foreach ($categories as $cat) {
$arg_news = array(
'orderby' => 'name',
'order' => 'ASC',
'posts_per_page' => 1,
'post_type' => 'post',
'post_status' => 'publish',
'cat' => $cat->cat_ID,
);
$query = new WP_Query($arg_news);
if ($query->have_posts()) while ($query->have_posts()) : $query->the_post();
?>
<div <?php post_class('g post') ?>>
<a href="<?php the_permalink();?>">
<div class="">
<p class=""><?php the_content(); ?></p>
</div>
</a>
</div>
<?php endwhile; wp_reset_postdata() ?>
<?php
}
}
?>
$connect->set_charset("utf8");
var_dump($connect->get_charset());
header("Content-Type: text/html; charset=UTF-8");