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 | |
remove_action('wp_head','wp_enqueue_scripts'); | |
remove_action('wp_head', 'rsd_link'); | |
remove_action('wp_head', 'wlwmanifest_link'); | |
remove_action('wp_head', 'wp_generator'); |
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 | |
function true_register_wp_sidebars() { | |
/* В боковой колонке */ | |
register_sidebar( | |
array( | |
'id' => 'true_side', // уникальный id | |
'name' => 'Боковая колонка', // название сайдбара | |
'description' => 'Перетащите сюда виджеты, чтобы добавить их в сайдбар.', // описание | |
'before_widget' => '<div id="%1$s" class="widjet %2$s">', // по умолчанию виджеты выводятся <li>-списком |
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 | |
function new_excerpt_more( $more ) { | |
return '...'; | |
} | |
add_filter('excerpt_more', 'new_excerpt_more'); |
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 | |
//Задать миниатюру в functions.php | |
if ( function_exists( 'add_theme_support' ) ) | |
add_theme_support( 'post-thumbnails' ); | |
add_image_size( 'lol-thumb', 700, 300, true ); //Жесткий обрезчик миниатюр | |
<?php the_post_thumbnail('lol-thumb');?> //Вывод |
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 foreach((get_the_category()) as $category) { echo '<a href="'.get_category_link($category->cat_ID).'" title="'.$category->cat_name.'">'.$category->cat_name.'</a> '; } ?> |
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="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta http-equiv="Content-type" content="text/html; charset=<?php bloginfo('charset'); ?>"> | |
<title><?php wp_title('«', true, 'right'); ?></title> | |
<?php wp_head(); ?> | |
</head> | |
<body <?php body_class(); ?>> //Нужные классы в боди |
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 | |
<div class="news"> | |
<?php while ( have_posts() ) : the_post(); ?> | |
<div class="news-item is-post is-post-excerpt" <?php post_class(); ?> id="post-<?php the_ID(); ?>"> | |
<ul class="post-info"> | |
<li>Категория: <?php foreach((get_the_category()) as $category) { echo '<a href="'.get_category_link($category->cat_ID).'" title="'.$category->cat_name.'">'.$category->cat_name.'</a> '; } ?></li> | |
<li><?php comments_number(); ?></li> | |
<li><?php echo get_the_date('F j, Y'); ?></li> | |
</ul> | |
<div class="post-img"> |
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 | |
function my_scripts_method() { | |
wp_deregister_script('jquery'); | |
wp_register_script( 'jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js', false, false, true ); | |
wp_register_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', false, false, true ); | |
wp_enqueue_script( 'jquery' ); | |
wp_enqueue_script( 'bootstrap'); | |
} | |
add_action( 'wp_enqueue_scripts', 'my_scripts_method' ); |
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 | |
function my_style_method() { | |
wp_register_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css' ); | |
wp_register_style( 'styles', get_template_directory_uri() . '/css/styles.css' ); | |
wp_enqueue_style( 'bootstrap'); | |
wp_enqueue_style( 'styles' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'my_style_method' ); |
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 | |
function custom_excerpt_length( $length ) { | |
return 20; | |
} | |
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); |
OlderNewer