diff --git a/blocks/citata.php b/blocks/citata.php index bc214a8..ad0c9a9 100644 --- a/blocks/citata.php +++ b/blocks/citata.php @@ -1,33 +1,37 @@ 1, - 'category' => 7, // 7 - мнения - 'orderby' => 'date', - 'order' => 'DESC', - 'include' => array(), - 'exclude' => array(), - 'meta_key' => '', - 'meta_value' =>'', - 'post_type' => 'post', - 'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса -) ); +$key = 'vij_citata'; + +if (!$posts = kuri_set($key)) { + + $posts = get_posts( array( + 'numberposts' => 1, + 'category' => 7, // 7 - мнения + 'orderby' => 'date', + 'order' => 'DESC', + 'include' => array(), + 'exclude' => array(), + 'meta_key' => '', + 'meta_value' =>'', + 'post_type' => 'post', + 'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса + )); + + kuri_set($key, $posts); + +} # вывод поста if( $posts ): - foreach($posts as $post): - setup_postdata( $post ); - ?> + foreach($posts as $post):?> -
+
цитата
<?the_title();?> - +
3, - 'category' => 22, // пока без категории - 'orderby' => 'date', - 'order' => 'DESC', - 'include' => array(), - 'exclude' => array(), - 'meta_key' => '', - 'meta_value' =>'', - 'post_type' => 'post', - 'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса -) ); +$key = 'vij_mosts'; + +if (!$mosts = kuri_set($key)) { + + $mosts = get_posts( array( + 'numberposts' => 3, + 'category' => 22, // пока без категории + 'orderby' => 'date', + 'order' => 'DESC', + 'include' => array(), + 'exclude' => array(), + 'meta_key' => '', + 'meta_value' =>'', + 'post_type' => 'post', + 'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса + )); + + kuri_set($key, $mosts); +} # вывод поста -if( $posts ):?> +if( $mosts ):?> -
+

Самое читаемое

- - -
- - + + + +
- + diff --git a/blocks/opinion.php b/blocks/opinion.php index f6daa75..1f3a880 100644 --- a/blocks/opinion.php +++ b/blocks/opinion.php @@ -1,33 +1,38 @@ 1, - 'category' => 7, // 7 - мнения - 'orderby' => 'date', - 'order' => 'DESC', - 'include' => array(), - 'exclude' => array(), - 'meta_key' => '', - 'meta_value' =>'', - 'post_type' => 'post', - 'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса -) ); +$key = 'vij_opinions'; + +if (!$opinions = kuri_set($key)) { + $opinions = get_posts( array( + 'numberposts' => 1, + 'category' => 7, // 7 - мнения + 'orderby' => 'date', + 'order' => 'DESC', + 'include' => array(), + 'exclude' => array(), + 'meta_key' => '', + 'meta_value' =>'', + 'post_type' => 'post', + 'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса + )); + + kuri_set($key,$opinions); +} # вывод поста -if( $posts ): +if($opinions ): - foreach($posts as $post): - setup_postdata( $post ); + foreach($opinions as $post): + setup_postdata( $opinions ); ?> -
+
мнение
- <?the_title();?> -
+ <?=$post->post_title;?> +
+
diff --git a/functions.php b/functions.php index 411fed0..e534318 100644 --- a/functions.php +++ b/functions.php @@ -14,4 +14,41 @@ add_theme_support('post-thumbnails'); # регистрируем размеры миниатюр add_image_size( 'left-thumb', 95, 84, true ); # для левой колонки -add_image_size( 'moread', 372, 216, true ); # читайте также \ No newline at end of file +add_image_size( 'moread', 372, 216, true ); # читайте также + + +#add scripts +/** +function tutsplus_burger_menu_scripts() { + + wp_enqueue_script( 'burger-menu-script', get_stylesheet_directory_uri() . '/scripts/burger-menu.js', array( 'jquery' ) ); + +} +add_action( 'wp_enqueue_scripts', 'tutsplus_burger_menu_scripts' ); +*/ + +/** add mobile block */ +function mob_block($template){ + + $subclass = " mob-lite"; + include get_template_directory().$template; + +} + + +function kuri_set($name = null, $value = null) { + + static $vars = array(); + + if ($name == null) + return $vars; + + if ($value == null){ + if(array_key_exists($name, $vars)) + return $vars[$name]; + } + else + $vars[$name] = $value; + return false; + +} \ No newline at end of file diff --git a/header.php b/header.php index 737798d..914f9b6 100644 --- a/header.php +++ b/header.php @@ -4,8 +4,10 @@ <?php wp_title('|', true, 'right');?> - + + + @@ -35,10 +37,21 @@ +
  • + + + + +
    diff --git a/index.php b/index.php index faec580..93b7eb8 100644 --- a/index.php +++ b/index.php @@ -34,8 +34,10 @@ $nn = 0;?>
    - - <?the_title();?> + +
    + <?the_title();?> +

    @@ -68,10 +70,18 @@ $nn = 0;?>
    + + + + + + + +
    - \ No newline at end of file + diff --git a/scripts/burger-menu.js b/scripts/burger-menu.js new file mode 100644 index 0000000..a5b5c23 --- /dev/null +++ b/scripts/burger-menu.js @@ -0,0 +1,7 @@ +jQuery(document).ready(function() { + jQuery('.toggle-nav').click(function(e) { + jQuery('.menu.main ul').slideToggle(500); + e.preventDefault(); + }); + +}); \ No newline at end of file diff --git a/single.php b/single.php index 715e501..bd63c84 100644 --- a/single.php +++ b/single.php @@ -40,7 +40,9 @@
    - <?the_title();?> +
    + <?the_title();?> +
    diff --git a/style.css b/style.css index 55f3888..36332a9 100644 --- a/style.css +++ b/style.css @@ -341,6 +341,7 @@ a{ width: 20px; height: 15px; margin-left: 18px; + cursor: pointer; } .btn_search{ @@ -369,6 +370,11 @@ a{ max-width: 700px; } + #post-img{ + /**text-align: center;*/ + background: #F5F5F5; + } + .page-numbers { display: inline-block; padding: 5px 10px; @@ -385,8 +391,7 @@ a{ a.page-numbers:hover { background: #f9f9f9; - - } + } h1{ @@ -399,12 +404,8 @@ a{ .mini-card-block{ display: grid; - grid-template-columns: repeat(auto-fit, minmax(372px, 372px)); - grid-gap: 2rem; - } - - .mini-card{ - max-width: 372px; + grid-gap: 2rem; + grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } @@ -414,8 +415,15 @@ a{ } .mini-card-img{ - width: 372px; - height: 216px; + /** width: 372px; + height: 216px; */ + width: 100%; + } + + + .card-img-top{ + text-align: center; + width: 100%; } @@ -441,6 +449,7 @@ a{ padding-bottom: 22px; margin: 8px 0 32px 0; border-bottom: 1px solid #E9EAEB; + width: 100%; /*text-align: center; */ } @@ -480,12 +489,15 @@ a{ } -#mosts{ +.mosts{ background-color: #00466A; width: 100%; padding: 22px; } + + + .most_title{ color: #2D9CDB; } @@ -501,6 +513,7 @@ a{ color: #FFFFFF; } + .left_preview{ border-radius: 50%; width: 95px; @@ -602,14 +615,14 @@ a{ .moread{ display: grid; - grid-template-columns: repeat(auto-fit, minmax(372px, 380px)); - grid-gap: 1rem; + grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); + grid-gap: 2rem; margin-top: 8px; margin-bottom: 28px; } .moread_card{ - padding-right: 12px; + } .moread_rubric{ @@ -625,8 +638,8 @@ a{ } .moread_card IMG{ - width: 372px; - height: 216px; + width: 100%; + /*height: 216px;*/ float: top; } @@ -665,10 +678,11 @@ a{ .yets{ display: grid; - grid-gap: 1rem; - grid-template-columns: repeat(auto-fit, 320px); + grid-gap: 1rem; + grid-template-columns: repeat(auto-fi, minmax(300px, 1fr)); margin-top: 8px; margin-bottom: 28px; + width: 100%; } .yet_card{ @@ -772,7 +786,86 @@ img-fluid{ text-align: center; } -@media (max-width: 640px) { +.toggle-nav { + display: none !important; +} + + + +#gamburer_menu{ + display: none; +} + + +.mob-lite{ + display: none; +} + + +@media screen and ( max-width: 580px ) { + + .toggle-nav { + display: inline-block !important; + background: url(/wp-content/themes/vij/pub/icons/burger-15.png) no-repeat; + } + + .btn_rss{ + display: none; + } + + .menu.main { + display: inline-block; + position: relative; + background: #fff; + text-align: left; + } + + .menu.main ul { + display: none; + position: absolute; + overflow: auto; + top: 0px; + right: 0px; + z-index: 999; + padding-right: 15px; + background: #fff; + } + + .menu.main ul li { + float: none; + display: block; + position: relative; + top: 0px; + right: 0px; + min-width: 100px; + background: #fff; + text-align: right; + } + + + #gamburer_menu a{ + font-weight: bold; + } + + + + .mob-lite{ + display: inline-block !important; + margin-top: 12px; + } + + + .main.menu li:after { + content: none; + } + + +} + + + +/** ultrabooks and ipads **/ +@media (max-width: 768px) { #left{ display: none; @@ -796,11 +889,12 @@ img-fluid{ #content{ margin: 8px; - width: 540px; + width: 100%; } - .img-fluid{ - max-width: 80%; + #mini-card-block{ + display: grid; + width: 100%; } @@ -812,6 +906,28 @@ img-fluid{ } +/** mobile **/ +@media only screen +and (min-device-width : 375px) +and (max-device-width : 667px) { + + #content{ + margin: 8px; + width: 100%; + } + + .mini-card{ + width: 100%; + padding-right: 12px; + } + + .mini-card-img{ + width: 100%; + } + +} + +