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
@echo off | |
SET st2Path=C:\Program Files\Sublime Text 3\sublime_text.exe | |
rem add it for all file types | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f | |
rem add it for folders | |
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f |
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 hide_cat_widget($args){ | |
$args ["hide_empty"] = 0; | |
return $args; | |
} | |
add_filter("widget_categories_args","hide_cat_widget"); |
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 ); |
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 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 | |
<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
<!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 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
<?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 | |
function new_excerpt_more( $more ) { | |
return '...'; | |
} | |
add_filter('excerpt_more', 'new_excerpt_more'); |