<div class="tags">
[exec]
if($options['mts_tags'] == '1') {
$tags = get_tags();
foreach ( $tags as $tag ) {
$tag_link = get_tag_link( $tag->term_id );
echo '<span class="tagtext">';
echo '<a href="' . $tag_link . '" title="' . $tag->name . '" class="' . $tag->slug . '">' . $tag->name . '</a>';
echo '</span>';
}
}
[/exec]
</div> .label {
position: relative;
}<div>
<h2></h2>
<div class="entry-info"></div>
<img>
<div class="label"></div>
<p></p>
<div class="clear"></div>
<div class="entry-info-bottom"></div>
</div><div>
<h2></h2>
<div class="entry-info"></div>
<div class="image_with_label">
<div class="label"></div>
<img>
</div>
<p></p>
<div class="clear"></div>
<div class="entry-info-bottom"></div>
</div> if ( !is_front_page() || !is_home() ){ }$my_command = '';
$my_post_id = '';
if (!empty($_GET)) {
foreach ($_GET as $key => $value) {
if ( !empty($key) && !empty($value) ) {
$my_command = $key;
$my_post_id = $value;
}
}
}
//Не забудьте обезвредить все, что злоумышленники передадут в GET запрос
if ($my_command == 'get_post_content_by_id' && $my_post_id != '') {
//Здесь выводим информацию на основе полученого GET запроса, например:
$content_all = get_post($my_post_id);
$content = $content_all->post_content;
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
echo $content;
} else if ($my_command == 'get_post_excerpt_by_id' && $my_post_id != '') {
//Другой запрос
$excerpt_all = get_excerpt($my_post_id);
$excerpt = $excerpt_all->post_excerpt;
echo $excerpt;
} else {
//Если нет запроса, выводим обычное содержание страницы
get_header();
//...
get_footer();
}jQuery.get( "/_my_page_url_/", { get_post_content_by_id: "123"} );global $post;
$categories = get_the_category();
foreach($categories as $category) {
echo $category->cat_ID;
}global $product; //Если не объявлен ранее. Не уверен в необходимости.
global $post;
$categories = get_the_terms( $post->ID, 'product_cat' );
foreach ($categories as $category) {
echo $category->term_id; //Может быть в нескольких категориях
} <div> … </div>
<div> … </div>
<div> … </div>div {
background-attachment: fixed;
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
background-image: url('http://...');
} function show_posts_by_taxonomies( $atts ){
$xhtml = '';
extract( shortcode_atts( array(
'taxonomies' => '',
), $atts ) );
if ($taxonomies == '') { return; }
$taxonomies_query = new WP_Query( array(
'post_type' => array( $taxonomies ),
'posts_per_page' => -1,
));
$xhtml .= '<ul>';
while ( $taxonomies_query->have_posts() ) : $taxonomies_query->the_post();
$xhtml .= '<li>' .get_the_title( get_the_ID() ) . '</li>';
endwhile;
wp_reset_postdata();
$xhtml .= '</ul>';
return $xhtml;
}
add_shortcode( 'show_rectangle', 'show_posts_by_taxonomies' );[show_rectangle taxonomies="my_custom_post_type"]echo do_shortcode( '[show_rectangle taxonomies="my_custom_post_type"]' );