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
show_admin_bar(false); | |
add_theme_support('post-thumbnails'); | |
remove_action( 'wp_head', 'feed_links_extra', 3 ); | |
remove_action( 'wp_head', 'feed_links', 2 ); | |
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 $url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'large' ); $url = $url['0']; ?> |
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
//Цели для Яндекс.Метрики и Google Analytics | |
$(".count_element").on("click", (function() { | |
ga("send", "event", "goal", "goal"); | |
yaCounterXXXXXXXX.reachGoal("goal"); | |
return true; | |
})); |
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 | |
$idObj = get_category_by_slug('s_about'); | |
$id = $idObj->term_id; | |
echo get_cat_name($id); | |
?> |
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_posts() ) : query_posts('p=1'); | |
while (have_posts()) : the_post(); ?> | |
<?php the_title(); ?> | |
<?php the_content(); ?> | |
<?php the_post_thumbnail(array(100, 100)); ?> | |
<? endwhile; endif; wp_reset_query(); ?> |
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
//In Template | |
<?php | |
$options = get_option('sample_theme_options'); | |
echo $options['phone1']; | |
?> | |
//in functions.php | |
require_once ( get_stylesheet_directory() . '/theme-options.php' ); | |
//theme-options.php file: |
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 = $wp_query->post; | |
if (in_category('cat_label_1')) { | |
include(TEMPLATEPATH.'/single-cat_label_1.php'); | |
} elseif (in_category('cat_label_2')) { | |
include(TEMPLATEPATH.'/single-cat_label_2.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
<?php | |
if ( have_posts() ) : // если имеются записи в блоге. | |
query_posts('cat=3'); // указываем ID рубрик, которые необходимо вывести. | |
while (have_posts()) : the_post(); // запускаем цикл обхода материалов блога | |
?> | |
<?php the_post_thumbnail(array(100, 100)); ?> | |
<? endwhile; // завершаем цикл. | |
endif; | |
/* Сбрасываем настройки цикла. Если ниже по коду будет идти еще один цикл, чтобы не было сбоя. */ | |
wp_reset_query(); |
OlderNewer