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
| <ul class="products"> | |
| <?php | |
| $args = array( 'post_type' => 'product', | |
| 'posts_per_page' => 5, | |
| 'product_cat' => 'addit', | |
| 'orderby' => 'rand' | |
| ); | |
| $loop = new WP_Query( $args ); | |
| while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?> |
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 | |
| global $product; | |
| $attachment_ids = $product->get_gallery_attachment_ids(); | |
| foreach( $attachment_ids as $attachment_id ) | |
| { | |
| echo $image_link = wp_get_attachment_url( $attachment_id ); | |
| } | |
| ?> |
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> | |
| <!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]--> | |
| <!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]--> | |
| <!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]--> | |
| <!--[if (gte IE 9)|!(IE)]><!--><html lang="ru"> <!--<![endif]--> | |
| <head> | |
| <meta charset="utf-8"> |
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
| if( get_field( "text_field" ) ): ?> | |
| <p><?php the_field( "text_field" ); ?></p> | |
| <?php endif; ?> |
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
| // фильтр передает переменную $template - путь до файла шаблона. Изменяя этот путь мы изменяем файл шаблона. | |
| add_filter('template_include', 'my_template'); | |
| // функция фильтрации | |
| function my_template( $template ) { | |
| # аналог второго способа | |
| // если это страница со слагом portfolio, используем файл шаблона page-portfolio.php | |
| // используем условный тег is_page() | |
| if( is_page('portfolio') ){ |
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
| define('DB_HOST', '127.0.0.1:3351'); |
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 ( !empty($cat) ) : | |
| $parent_cat = get_category($cat); | |
| $output = "<p>Дочерние рубрики раздела {$parent_cat->name}($cat):</p>"; | |
| $args = array( | |
| 'title_li' => null, | |
| 'child_of' => $cat, | |
| 'depth' => 1, | |
| 'echo' => 0, | |
| 'hide_empty' => 0, |
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", условие - $GLOBALS["APPLICATION"]->GetCurPage(true) != "/index.php" |
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
| <? if ($arSection["PICTURE"]["SRC"]){?><img src="<?=$arSection["PICTURE"]["SRC"]?>" title="<?=$arSection["NAME"]?>" border="0"/><br><?}?> |
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
| <? $curt=$APPLICATION->GetCurPage();?> |