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
| WOOF - WooCommerce Products Filter |
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 | |
| add_action( 'wp_ajax_do_something', 'get_posts_callback' ); // For logged in users | |
| add_action( 'wp_ajax_nopriv_do_something', 'get_posts_callback' ); | |
| function get_posts_callback(){ | |
| echo(json_encode( array('status'=>'ok','request_vars'=>$_REQUEST) )); | |
| wp_die(); | |
| } | |
| function js_variables(){ | |
| $variables = 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
| $resultName = woocommerce_get_product_terms($product->id, 'pa_topping'); |
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();?> |
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
| Для главной - Тип условия "без условия", для всех остальных Тип условие "Выражение 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
| <?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
| 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
| // фильтр передает переменную $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
| if( get_field( "text_field" ) ): ?> | |
| <p><?php the_field( "text_field" ); ?></p> | |
| <?php endif; ?> |