"service", 'orderby' => "date", 'order' => "ASC")); $posts = $query->get_posts(); $content = "
"; foreach ($posts as $key=>$post) { $class = ( $key & 1 ) ? "padding-left" : "right-border"; $class1 = ( $key>1) ? "" : "bottom-border"; $price = get_post_meta($post->ID, 'wpcf-price'); $price = array_shift($price); $thumb = get_the_post_thumbnail_url( $post->ID, 'full' ); $description = apply_filters('the_excerpt', get_post_field('post_excerpt', $post->ID)); $content .= "

".get_the_title($post->ID)."

".$description."

$price Подробнее...
"; } return $content; } function get_address () { return get_theme_mod( "address" ); } function get_open_hours () { return get_theme_mod( "open-hours" ); } function get_email () { return get_theme_mod( "email" ); } function get_map () { $coordinates = get_theme_mod( "coordinates" ); $hint = get_theme_mod( "hint" ); $baloon = get_theme_mod( "baloon" ); $baloon_size = getimagesize($baloon); $baloon_size = str_replace ('width=', '', $baloon_size[3]); $baloon_size = str_replace ('height=', '', $baloon_size); $baloon_size = str_replace ('"', '', $baloon_size); $baloon_size = str_replace (' ', ',', $baloon_size); $width = (int)str_replace (',', '.', $baloon_size); $offset = "-".intval($width/2).",-".$width; echo " "; } add_shortcode( 'email', 'get_email' ); add_shortcode( 'open-hours', 'get_open_hours' ); add_shortcode( 'address', 'get_address' ); add_shortcode( 'main-services', 'get_services' ); add_shortcode( 'map', 'get_map' ); ?>