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 | |
/* | |
Template Name: Customers | |
*/ | |
// WP_Query arguments | |
$args = array ( | |
'post_type' => 'customer', | |
'post_status' => 'publish', | |
'pagination' => true, |
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
<div class="hdr">Российские Кабеленесущие Системы это:</div> | |
<div class="info-items"> | |
<a class="item" href="#"> | |
<div class="num">1</div> | |
<div class="txt">Выполнение заказа от 3-х дней</div> | |
</a> | |
<a class="item" href="#"> | |
<div class="num">2</div> | |
<div class="txt">Разумная цена</div> | |
</a> |
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
function os_rewrite_rules(){ | |
$options = get_option( 'os_ub_settings', array( 'os_ub_text_slug' => 'company' ) ); | |
$slug = $options['os_ub_text_slug']; | |
$cat_slug = $options['os_ub_cat_slug']; | |
add_rewrite_rule('^'.$slug.'/add/?','index.php?page_id=os_ub_add_page','top'); | |
// dev | |
// flush_rewrite_rules( true ); |
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 ( false === ( $vip_loop = get_transient( 'last_vips' ) ) ) { | |
$args = array( | |
'posts_per_page' => 100, // берем либо все посты, либо какое-то большое число | |
// по желанию отключаем лишнее | |
// 'no_found_rows' => true, | |
// 'cache_results' => false, | |
// 'update_post_term_cache' => false, | |
// 'update_post_meta_cache' => false, |
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 | |
/* подключаем скрипт */ | |
function os_ya_like_script() { | |
wp_enqueue_script( 'yashare', '//yandex.st/share/share.js', null, '1', true ); | |
} | |
add_action( 'wp_enqueue_scripts', 'os_ya_like_script' ); |
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
(function( $ ) { | |
"use strict"; | |
$(function() { | |
$(document).ready(function(){ | |
// тут код | |
}); | |
// а тут плагин | |
}); |
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteRule .*\.(jpe?g|gif|bmp|png)$ http://i.imgur.com/qX4w7.gif [L] | |
</IfModule> |
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 | |
/* | |
Plugin Name: OS Spam Comments Filter | |
Description: antispam | |
Author: [email protected] | |
Version: 1.1 | |
*/ | |
function verify_comment_meta_data( $commentdata ) { |
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
// добавить этот код в functions.php | |
function os_styles_and_scripts() { | |
if(!is_admin()){ | |
wp_enqueue_script( 'yashare', '//yandex.st/share/share.js', null, '1', true ); | |
} | |
} | |
add_action( 'wp_enqueue_scripts', 'os_styles_and_scripts' ); |
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
function os_my_link_shortcode( $atts ) { | |
extract( shortcode_atts( | |
array( | |
'link' => '', | |
), $atts ) | |
); | |
if(is_user_logged_in()){ | |
$out=$link; | |
} else { |