From 00a24c10eba4ae2d2f7027205bc3844b4415c1bd Mon Sep 17 00:00:00 2001 From: Alexander Yakovlev Date: Tue, 14 Aug 2018 13:30:38 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BF=D0=B8=D1=81=D0=BE=D0=BA=20=D0=B8?= =?UTF-8?q?=D0=B3=D1=80=20(=D1=88=D0=BE=D1=80=D1=82=D0=BA=D0=BE=D0=B4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions.php | 4 +++ shortcodes/gamelist.php | 65 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 shortcodes/gamelist.php diff --git a/functions.php b/functions.php index da3cb50..7531f99 100644 --- a/functions.php +++ b/functions.php @@ -1,4 +1,6 @@ 'Основная номинация', + 'translations' => 'Переводы', + 'unranked' => 'Вне конкурса' + ); + + $a = shortcode_atts( array( + 'category' => 'КРИЛ '.date('Y'), + ), $atts ); + $category = $a['category']; + + $retval = ''; + $args = array( + 'numberposts' => -1, + 'post_status' => 'publish', + 'post_type' => 'game', + 'meta_key' => 'nomination', + ); + foreach ($nominations as $nomination => $name) { + $i = 1; + // $args['category'] = $category; + $args['meta_value'] = $nomination; + $the_query = new WP_Query($args); + if( $the_query->have_posts() ) { + while( $the_query->have_posts() ) { + $the_query->the_post(); + $retval .= '

'.$name.'

'; + $retval .= '
'; + if ($i > 1) { + $retval .= '
'; + } + $retval .= '
'; + $retval .= '
'. + ''.get_the_title().'
Авторы:'. + get_field('authors').'
'. + '
Платформа: '.get_field('platform').'
'. + '
'. + '

'.get_the_post_thumbnail().'

'. + '
'.get_the_content().'
'; + $online = get_field('link_online'); + $offline = get_field('link_offline'); + if (!empty($online) || !empty($offline)) { + $retval .= ''; + } + $retval .= '
'; + $i++; + } + $retval .= '
'; + } + } + return $retval; +}