This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| strip_tags(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Склоняем даты постов | |
| function russian_date( $tdate = '' ) { | |
| if ( substr_count($tdate , '---') > 0 ) return str_replace('---', '', $tdate); | |
| $treplace = array ( | |
| "Январь" => "января", | |
| "Февраль" => "февраля", | |
| "Март" => "марта", | |
| "Апрель" => "апреля", | |
| "Май" => "мая", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <article> | |
| <?php | |
| $current_page = (get_query_var('paged')) ? get_query_var('paged') : 1; // определяем текущую страницу блога | |
| $args = array( | |
| 'posts_per_page' => get_option('posts_per_page'), // значение по умолчанию берётся из настроек, но вы можете использовать и собственное | |
| 'paged' => $current_page // текущая страница | |
| ); | |
| query_posts( $args ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| if ( have_posts() ) : // если имеются записи в блоге. | |
| query_posts('cat=55,66'); // указываем ID рубрик, которые необходимо вывести. | |
| while (have_posts()) : the_post(); // запускаем цикл обхода материалов блога | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Start the Loop. --> | |
| <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); $postcounter++;?> | |
| <!-- Далее проверяется, находится ли текущая запись в рубрике 5. --> | |
| <!-- Если да, то блоку div, будет присвоен класс "post-cat-three". --> | |
| <!-- Иначе, блоку div будет присвоен класс "post". --> | |
| <?php if ( in_category('5') ) { ?> | |
| <div class="col-sm-6"> | |
| <?php } else { ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php print $user->uid;?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class='enter'> | |
| <?php if($logged_in){ ?> | |
| <a href="/user" class="a_enter">Профиль</a> | |
| <a href="/user/logout" class="a_enter" id="a_enter">Выйти</a> | |
| <?php } else { ?> | |
| <a href="<?php print base_path().'user' ?>" title="" class="a_enter" id="a_enter1" >Вход</a> | |
| <a href="/user/register" title="<?php print $site_name; ?>" class="a_enter" id="a_enter2" >Регистрация</a> | |
| <?php } ?> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Document</title> | |
| </head> | |
| <body> | |
| </body> | |
| </html> |
NewerOlder