This file contains 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 $post; // не обязательно | |
// параметры по умолчанию | |
$args = array( | |
'numberposts' => 5, // 5 записей | |
'category' => 9, // из рубрики 9 | |
'orderby' => 'date', | |
'order' => 'DESC', | |
'include' => array(), |
This file contains 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_rows('repeater_field_name') ): ?> | |
<?php while( have_rows('repeater_field_name') ): the_row(); | |
$image = get_sub_field('image'); | |
$content = get_sub_field('content'); | |
?> | |
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt'] ?>" /> | |
<?php echo $content; ?> |
This file contains 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
// .htaccess | |
php_value max_input_vars 3000 | |
php_value max_execution_time 120 | |
// Indexes | |
DirectoryIndex myindex.php | |
Options +Indexes | |
// Password | |
AuthType Basic |
This file contains 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 | |
/** | |
* The main functions file | |
* | |
*/ | |
// Убираем лишнее | |
remove_action( 'wp_head', 'wp_generator' ); | |
remove_action( 'wp_head', 'wlwmanifest_link' ); |
This file contains 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 | |
/* | |
* Template Name: НазваниеШаблона | |
* Template Post Type: post, page, product | |
*/ | |
get_header(); | |
?> |
This file contains 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 <?php language_attributes(); ?>> | |
<head> | |
<meta charset="<?php bloginfo( 'charset' ); ?>"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<!-- for 500px min-width body --> | |
<!-- <meta name="viewport" content="width=device-width, initial-scale=0.64, maximum-scale=0.64, shrink-to-fit=no"> --> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<!-- <meta name="format-detection" content="telephone=no"> --> | |
<meta name="description" content="<?php bloginfo( 'description' ); ?>"> |
This file contains 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 | |
// Заменяем шаблон post зависимости от категории (functions.php) | |
add_filter('template_include', 'service_template'); | |
function service_template( $template ) { | |
global $post; | |
if( ( is_single() && in_category( 1, $post ) ) ) { | |
$template = get_stylesheet_directory() . '/single-service.php'; |
This file contains 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
// Если на странице поста, выводит "active" | |
<?php if( is_single( $post ) ) { echo 'active'; }; ?> |
This file contains 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
<style> | |
.loader { | |
background: none repeat scroll 0 0 #ffffff; | |
bottom: 0; | |
height: 100%; | |
left: 0; | |
position: fixed; | |
right: 0; | |
top: 0; | |
width: 100%; |
OlderNewer