<div>Определение по Яндексу</div>
<div id="ya_whoami"></div>
<div id="info_map_ip" style="width:1px; height:1px;display:none;opacity:0;"></div>
<script src="http://api-maps.yandex.ru/2.0/?load=package.standard&lang=ru-RU" type="text/javascript"></script>
<script>
ymaps.ready(init);
function init() {
// Данные о местоположении, определённом по IP
var geolocation = ymaps.geolocation,
// координаты
coords = [geolocation.latitude, geolocation.longitude],
myMap = new ymaps.Map('info_map_ip', {
center: coords,
zoom: 10
});
/*
alert(geolocation.country);
alert(geolocation.city);
alert(geolocation.region);
*/
//if(geolocation.country.indexOf('Россия') >= 0) {
//if(geolocation.region.indexOf('Москва') < 0) {
document.getElementById("ya_whoami").innerHTML = "<div><b>Страна</b> "+geolocation.country+"</div>"+"\r\n"+
"<div><b>Город</b> "+geolocation.city+"</div>"+"\r\n"+
"<div><b>Регион</b> "+geolocation.region+"</div>"+"\r\n";
}
</script>
<noindex>
<noindex>
. Тег работает аналогично мета-тегу noindex, но распространяется только на текстовый контент, заключенный внутри тега в формате:<noindex>текст, индексирование которого нужно запретить</noindex>
<!--noindex-->текст, индексирование которого нужно запретить<!--/noindex-->
<!--googleoff: all--> текст <!--/googleoff: all-->
function SearchFilter($query) {
if ($query->is_search) {
$query->set('post_type', 'post');
}
return $query;
}
add_filter('pre_get_posts','SearchFilter');
add_filter('register_post_type_args', function($args, $post_type) {
if (!is_admin() && $post_type == 'page') {
$args['exclude_from_search'] = true;
}
return $args;
}, 10, 2);
function denisco_scripts() {
$tpl = plugin_dir_url(__FILE__);
wp_enqueue_style('denisco', $tpl . '/style.css');
wp_enqueue_script('denisco', $tpl . '/scripts.js', array('jquery'), null, true);
}
add_action('wp_enqueue_scripts', 'denisco_scripts');
<?php
function denisco_footer() { ?>
<script>alert('hello');</script>
<?php }
add_action( 'wp_footer', 'denisco_footer' );
?>
<?php
function denisco_head() { ?>
<script>alert('hello');</script>
<?php }
add_action( 'wp_head', 'denisco_head' );
?>
<head>
<script>
var metaTag=document.createElement('meta');
metaTag.name = "viewport";
if (screen.width <= 479) {
metaTag.content = "width=480, user-scalable=false"
window.addEventListener("orientationchange", function() {
viewport = document.querySelector("meta[name=viewport]");
if(window.orientation === 90 || window.orientation === -90){
viewport.setAttribute('content', 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=false');
} else{
viewport.setAttribute('content', 'width=480, user-scalable=false');
};
}, false);
} else{
metaTag.content = "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=false"
};
document.getElementsByTagName('head')[0].appendChild(metaTag);
</script>
</head>
try_files $uri $uri/ /index.php?$args;
location ~ [^/]\.ph(p\d*|tml)$ {
try_files /does_not_exists @fallback;
}
server {
server_name mysite.ru www.mysite.ru;
listen 178.100.100.97;
charset UTF-8;
disable_symlinks if_not_owner from=$root_path;
set $root_path /var/www/mysite/data/www/mysite.ru;
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
root $root_path;
access_log /var/www/nginx-logs/mysite isp;
access_log /var/www/httpd-logs/mysite.ru.access.log ;
error_page 404 = @fallback;
}
location / {
try_files $uri $uri/ /index.php?$args;
location ~ [^/]\.ph(p\d*|tml)$ {
try_files /does_not_exists @fallback;
}
}
location ~* ^/(webstat|awstats|webmail|myadmin|pgadmin)/ {
proxy_pass http://178.100.100.97:81;
proxy_redirect http://178.100.100.97:81/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
location @fallback {
proxy_pass http://178.100.100.97:81;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
location ^~ /webstat/ {
auth_basic "Restricted area";
auth_basic_user_file /var/www/mysite/data/etc/31337.passwd;
try_files $uri @fallback;
}
include /usr/local/ispmgr/etc/nginx.inc;
}