diff --git a/blocks/gamburger-pets.php b/blocks/gamburger-pets.php index 1deac33..d121c89 100644 --- a/blocks/gamburger-pets.php +++ b/blocks/gamburger-pets.php @@ -37,7 +37,7 @@ else{
- +
+ + + + + + + + \ No newline at end of file diff --git a/pub/css/pets.css b/pub/css/pets.css index 66c6107..f8220b7 100644 --- a/pub/css/pets.css +++ b/pub/css/pets.css @@ -65,7 +65,7 @@ body { max-width: 200px; left: 0; top: 0; - margin: 0 0 0 22px; + margin: 0 0 0 2%; padding: 0; } @@ -218,9 +218,31 @@ ul.pets-menu-left{ } +@media (max-width: 375px) { + + #petslogo{ + width: 100%; + max-width: 100%; + margin: 0; + padding: 0 0 0 4px; + } + + .pets-dog{ + width: 133px; + } + + +} + + @media (max-width: 767px) { + body{ + width: 100%; + } + + .toggle-nav-pets { background: url(/wp-content/themes/vij/pub/icons/gumburger.svg) no-repeat; width: 20px; diff --git a/rsscreate.php b/rsscreate.php index 1acd97b..00475ca 100644 --- a/rsscreate.php +++ b/rsscreate.php @@ -1,57 +1,82 @@ )\s*(\<)/m', '$1$2', $html); - return preg_replace('//', '', $html); - -} date_default_timezone_set('Europe/Moscow'); -$posts = get_posts( array( - 'numberposts' => 20, - 'category' => 2, - 'orderby' => 'date', - 'order' => 'DESC', - 'include' => array(), - 'exclude' => array(), - 'meta_key' => '', - 'meta_value' =>'', - 'post_type' => 'post', - 'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса -)); +//Яндекс Новости +create_rss_yandex(); -// Яндекс Новости -create_rss_file($posts, 'views/rss/yanews.php', '/vhosts/vetandlife.ru/rss/yanews.xml'); - -// Общая лента -create_rss_file($posts, 'views/rss/rssnews.php', '/vhosts/vetandlife.ru/rss/news.xml'); - +//Дзен +create_rss_dzen(); exit; -if( $posts ){ + +function create_rss_yandex(){ + + $posts = get_posts( array( + 'numberposts' => 20, + 'category' => 2, + 'orderby' => 'date', + 'order' => 'DESC', + 'include' => array(), + 'exclude' => array(), + 'meta_key' => '', + 'meta_value' =>'', + 'post_type' => 'post', + 'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса + )); + + + + // Яндекс Новости + create_rss_file($posts, 'views/rss/yanews.php', '/vhosts/vetandlife.ru/rss/yanews.xml'); + + // Общая лента + create_rss_file($posts, 'views/rss/rssnews.php', '/vhosts/vetandlife.ru/rss/news.xml'); + + //Турбо + create_rss_file($posts, 'views/rss/yaturbo.php', '/vhosts/vetandlife.ru/rss/turbo.xml'); + + return; - ob_start(); - include('views/rss/yanews.php'); - $result = ob_get_contents(); - ob_end_clean(); +} - $result = trim($result); - if ($result !== ''){ - file_put_contents('/vhosts/beta/rss/yanews.xml', trim($result)); - } +function create_rss_dzen(){ + + $subcategories = get_categories(array( + 'child_of' => 14, // pets + )); + + $subcategories_ids = array($parent_category_id); + + foreach ($subcategories as $subcategory) { + $subcategories_ids[] = $subcategory->term_id; + } + + $args = array( + 'category__in' => $subcategories_ids, + 'post_type' => 'post', + 'post_status' => 'publish', + 'posts_per_page' => 30, + 'orderby' => 'date', + 'order' => 'DESC', + ); + + $posts = get_posts($args); + + + create_rss_file($posts, 'views/rss/dzen.php', '/vhosts/vetandlife.ru/rss/dzen.xml'); + + + return; } @@ -60,7 +85,6 @@ function create_rss_file($posts, $temp, $file){ if( $posts ){ - ob_start(); include($temp); $result = ob_get_contents(); @@ -79,6 +103,51 @@ function create_rss_file($posts, $temp, $file){ } + +function getMimeTypeFromExtension($imageUrl) { + + $extension = pathinfo($imageUrl, PATHINFO_EXTENSION); + + switch (strtolower($extension)) { + case 'jpg': + case 'jpeg': + return 'image/jpeg'; + case 'png': + return 'image/png'; + case 'gif': + return 'image/gif'; + case 'webp': + return 'image/webp'; + default: + return false; // Неизвестное расширение + } + +} + +function filterHtml($html) { + + $html = trim($html); + $html = preg_replace('/(\>)\s*(\<)/m', '$1$2', $html); + return preg_replace('//', '', $html); + +} + + +function filtercontent($html){ + + $content = str_replace('

', '

', $content); + $content = str_replace('
', '

', $content); + $content = preg_replace('/<\/p>\s*

/', '

', $content); + $content = str_replace('', '', $content); + $content = str_replace('', '', $content); + $content = str_replace('', '', $content); + $content = str_replace('

', '', $content); + $content = strip_tags($content, '