function CSSLoad(file){
var link = document.createElement("link");
link.setAttribute("rel", "stylesheet");
link.setAttribute("type", "text/css");
link.setAttribute("href", file);
document.getElementsByTagName("head")[0].appendChild(link)
}
CSSLoad('/addStyles.css');
<?php $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; ?>
<?php
$args = array(
'cat' => '1',
'posts_per_page' => 6,
'paged' => $paged
);
?>
<?php $query = new WP_Query( $args ); ?>
<?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>
<a href="<?php echo get_permalink(); ?>" class="col-md-4 col-sm-6 col-xs-12 news-item">
<div class="image">
<img src="<?php
$large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' );
echo $large_image_url[0];
?>" alt="<?php the_title(); ?>">
</div>
<h1 class="h1"><?php the_title(); ?></h1>
<p class="content"><?php $content = get_the_content();
echo wp_trim_words( $content , '25' ); ?></p>
</a>
<?php endwhile; ?>
<?php
if (function_exists(ge_pagination)) {
ge_pagination($query->max_num_pages,"",$paged);
}
?>
<?php wp_reset_postdata(); ?>
<?php else: ?>
<p><?php _e('Новости не найдены('); ?></p>
<?php endif; ?>
<?php $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; ?>
<?php
$args = array(
'cat' => '1',
'posts_per_page' => 6,
'paged' => $paged
);
?>
<?php $query = new WP_Query( $args ); ?>
<?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>
<a href="<?php echo get_permalink(); ?>" class="col-md-4 col-sm-6 col-xs-12 news-item">
<div class="image">
<img src="<?php
$large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' );
echo $large_image_url[0];
?>" alt="<?php the_title(); ?>">
</div>
<h1 class="h1"><?php the_title(); ?></h1>
<p class="content"><?php $content = get_the_content();
echo wp_trim_words( $content , '25' ); ?></p>
</a>
<?php endwhile; ?>
<?php
if (function_exists(ge_pagination)) {
ge_pagination($query->max_num_pages,"",$paged);
}
?>
<?php wp_reset_postdata(); ?>
<?php else: ?>
<p><?php _e('Новости не найдены('); ?></p>
<?php endif; ?>