<?php query_posts("cat=10&posts_per_page=3"); ?>
<?php while (have_posts()) : the_post(); ?>
<div class="first-news clearfix">
<div class="big-miniature"></div>
<div class="data"><?php the_time('j F Y') ?></div>
<h2><a href="<?php echo get_permalink(); ?>"><?php the_title(); ?></a></h2>
<p class="text">
<? $excerpt = get_the_excerpt();
print string_limit_words($excerpt,65);?>
</p>
</div>
<?php endwhile; ?>
<?php query_posts("cat=10&posts_per_page=3"); ?>
<?php
$idx = 1;
while (have_posts()) : the_post(); ?>
<? if( $idx % 2 == 1) { /* выводим нечетные статьи*/ ?>
<div class="first-news clearfix">
<div class="big-miniature"></div>
<div class="data"><?php the_time('j F Y') ?></div>
<h2><a href="<?php echo get_permalink(); ?>"><?php the_title(); ?></a></h2>
<p class="text">
<? $excerpt = get_the_excerpt();
print string_limit_words($excerpt,65);?>
</p>
</div>
<? } else { /* выводим четные */?>
<div class="first-news clearfix">
<div class="data"><?php the_time('j F Y') ?></div>
<h2><a href="<?php echo get_permalink(); ?>"><?php the_title(); ?></a></h2>
<p class="text">
<? $excerpt = get_the_excerpt();
print string_limit_words($excerpt,65);?>
</p>
<div class="big-miniature"></div>
</div>
<? } ?>
<?php
$idx++;
endwhile;
?>
$id = the_field('3d');
do_shortcode('[sketchfab id="'.$id.'"]');
register_taxonomy( 'videocat', array('video'), $args );
register_taxonomy( 'videocat', array('videocat'), $args );
<img src="<?php echo get_template_directory(); ?>/landings/image-1.jpg">
[blog_list number="4" columns="4" show_style="0" show_type="0" related_slug="" tag__in="" post__not_in="" ]
if (is_user_logged_in()) {
$blog_u1_ID = ??? // your u1.mywp.ru blog id
global $current_user;
get_currentuserinfo();
if (is_user_member_of_blog( $current_user->ID, $blog_u1_ID)) {
echo "Current user is a member of blog u1"
};
}
global $post;
$tags = wp_get_post_tags( $post->ID);
foreach($tags as $tag) {
echo $tag['name'].'('.$tag['count'].')';
}
Array
(
[0] => stdClass Object
(
[term_id] => 4
[name] => tag2
[slug] => tag2
[term_group] => 0
[term_taxonomy_id] => 4
[taxonomy] => post_tag
[description] =>
[parent] => 0
[count] => 7
)
[1] => stdClass Object
(
[term_id] => 7
[name] => tag5
[slug] => tag5
[term_group] => 0
[term_taxonomy_id] => 7
[taxonomy] => post_tag
[description] =>
[parent] => 0
[count] => 6
)
[2] => stdClass Object
(
[term_id] => 16
[name] => tag6
[slug] => tag6
[term_group] => 0
[term_taxonomy_id] => 16
[taxonomy] => post_tag
[description] =>
[parent] => 0
[count] => 2
)
)
$tags = get_tags();
$html = '<div class="post_tags">';
foreach ( $tags as $tag ) {
$tag_link = get_tag_link( $tag->term_id );
$html .= "<a href='{$tag_link}' title='{$tag->name} Tag' class='{$tag->slug}'>";
$html .= "{$tag->name} ({$tag->count})</a>";
}
$html .= '</div>';
echo $html;