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 ( 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 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 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 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 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
$args = array( | |
'author_email' => '', | |
'ID' => '', | |
'karma' => '', | |
'number' => '', | |
'offset' => '', | |
'orderby' => '', | |
'order' => 'DESC', | |
'parent' => '', | |
'post_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
/* | |
don't forget to flush permalinks | |
/cpt-label/category/slug/ | |
*/ | |
function os_part_tags() { | |
add_rewrite_rule("^cpt-label/([^/]+)/page/([^/]+)/?",'index.php?post_type=cpt-label&cat=$matches[1]&paged=$matches[2]','top'); | |
add_rewrite_rule("^cpt-label/([^/]+)/([^/]+)/?",'index.php?cpt-label=$matches[2]','top'); | |
add_rewrite_rule("^cpt-label/?",'index.php?post_type=cpt-label','top'); | |
} |
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
<a href="javascript:(function(){var v="1.3.2";if(window.jQuery===undefined||window.jQuery.fn.jquery<v){var done=false;var script=document.createElement("script");script.src="http://ajax.googleapis.com/ajax/libs/jquery/"+v+"/jquery.min.js";script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;initMyBookmarklet();}};document.getElementsByTagName("head")[0].appendChild(script);}else{initMyBookmarklet();}function initMyBookmarklet(){(window.myBookmarklet=function(){jQuery(".nextProda").live("click",function(){if(typeof(localStorage)=='undefined'){alert('Ваш браузер не поддерживает localStorage()');}else{jQuery(document).scrollTop(localStorage.getItem('scroll'+encodeURIComponent(window.location.pathname)));}return false;});jQuery("body").append('<a href="#" class="nextProda" style="back |
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
function os_my_link_shortcode( $atts ) { | |
extract( shortcode_atts( | |
array( | |
'link' => '', | |
), $atts ) | |
); | |
if(is_user_logged_in()){ | |
$out=$link; | |
} else { |
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
// добавить этот код в 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' ); |
OlderNewer