// SHARE BTN
//===============js======================
function socialopen(url){
var winpar='width=500,height=400,left=' + ((window.innerWidth - 500)/2) + ',top=' + ((window.innerHeight - 400)/2) ;
window.open(url,'tvkw',winpar);
}
$('a.bt').click(function(){
var url = $(this).attr('href');
socialopen(url);
return false;
});
//===============html=====================
<ul class="social_share">
<li>
<a class="bt" href="https://twitter.com/share?url=<?php the_permalink(); ?>&text=<?php the_title(); ?>">
<i class="fa fa-twitter" aria-hidden="true"></i>
</a>
</li>
<li>
<a class="bt" href="http://www.facebook.com/sharer.php?u=<?php the_permalink(); ?>&title=<?php the_title(); ?>">
<i class="fa fa-facebook" aria-hidden="true"></i>
</a>
</li>
<li>
<a class="bt" href="http://vkontakte.ru/share.php?url=<?php the_permalink(); ?>&title=<?php the_title(); ?>">
<i class="fa fa-vk" aria-hidden="true"></i>
</a>
</li>
</ul>
Список с классом .social_share вставляется в каждую конкретную запись в цикле. $info = get_the_category()[0]->cat_ID
$query = new WP_Query( array(
'post_type' => 'post',
'cat'=>$info,
'post__not_in' =>get_the_ID(),
) );
if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>
<div class="card col-6 text-center"><div class="text-center"><?php the_post_thumbnail('thumbnail');?></div><div class="card-body"><a class="permlinccat" href="<?php the_permalink() ?>" title="Перейти к посту: <?php the_title(); ?>" ><div class="card-title h5"><?php the_title(); ?></div></a></div></div>
<?php endwhile; else: ?>
Постов не найдено
<?php endif; wp_reset_query(); ?>
<?php
require_once 'assets/theme_setup.php';
require_once 'assets/helpers.php';
require_once 'assets/post_types.php';
require_once 'assets/shortcodes.php';
require_once 'assets/ajax.php';
if (is_admin())
require_once 'assets/admin_panel_functions.php';
$('.click-link-btn').on('click', function(){
var $this = $(this),
product = $this.closest('.product'),
product_title = product.find('.product-title').text();
$('.modal-body #hidden_title').val('product_title');
});
UPDATE wp_options SET option_value = replace(option_value, 'http://denwerhost', 'http://newdomain.ru') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://denwerhost','http://newdomain.ru');
UPDATE wp_posts SET post_content = replace(post_content, 'http://denwerhost', 'http://newdomain.ru');
http://denwerhost
" заменить на ваш старых домен, а "http://newdomain.ru
" на новый и выполнить запрос, тогда все заработает. add_action('admin_enqueue_scripts', 'admin_scripts');
add_action('wp_enqueue_scripts', 'theme_scripts');
if(function_exists('geoip_detect2_get_info_from_current_ip')){
$location_code = geoip_detect2_get_info_from_current_ip()->country->isoCode;
if( $location_code !== 'UA'){
$classN = "no_UA";
}else{
$classN = "country_".$location_code;
}
}
<body class="<?= $classN ?>">
.no_UA #custom_html-5{
display: none !important;
}
.no_UA #custom_html-2{
display: none !important;
}
.no_UA #zen_widget-3{
display: none !important;
}
<?php
$query = new WP_Query( array('post_type' => 'post', 'posts_per_page'=>-1 );
?>
<?php if($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); ?>
<div class="col-sm-12 my-5 bg-primary">
<h1><?php the_title(); ?></h1>
<p><?php the_content(); ?></p>
</div>
<?php endwhile; endif; ?>