var iframe = document.getElementById('eventcontentid_ifr');
var reply_editor = jQuery(iframe).contents().find("#tinymce").html();
// jQuery('.wp-editor-area').val(''); // это добавьте если редактируете чтобы обнулить textarea и перезаписать на новый контент
jQuery('.wp-editor-area').val(reply_editor);
global $wpdb;
$users = $wpdb->get_results("SELECT meta_value FROM wp_usermeta WHERE meta_key = 'compony-city'");
foreach ($users as $value) {
$array[] = $value->meta_value;
}
$result = array_unique($array);
echo '<pre>';
var_dump($result);
echo '</pre>';
foreach($result as $city) { ?>
<div class="company-city">
<?php echo $city; ?>
</div>
<?php }
?>
<?php
$arg_cat = array(
//'orderby' => 'name',
'order' => 'ASC',
'hide_empty' => 1,
'exclude' => '',
'include' => '',
'taxonomy' => 'pricecat',
);
$categories = get_terms( $arg_cat );
// var_dump( $categories );
?>
<article class="article-post">
<div id="content_box" >
<?php if( $categories ){foreach( $categories as $cat ){
$arg_posts = array(
// 'orderby' => 'name',
'post_type' => 'price',
'post_status' => 'publish',
'posts_per_page' => -1,
'order' => 'DESC',
'tax_query' => array(
array(
'taxonomy' => 'pricecat',
'field' => 'slug',
'terms' => $cat->slug,
)
),
);
$query = new WP_Query($arg_posts);
?>
<?php if ($query->have_posts() ) ?>
<h2><?php echo $cat->name; ?> </h2>
<?php while ( $query->have_posts() ) : $query->the_post(); ?>
<div class="main-page-post">
<?php the_title(); ?>
</div>
<?php endwhile?>
<?php
}
}
?>
</div>
</article>
function get_custom_single_template($single_template) {
global $post;
if ($post->post_type == 'education') { // Тип записи
$terms = get_the_terms($post->ID, 'educations'); // название таксономии
if($terms && !is_wp_error( $terms )) {
//Make a foreach because $terms is an array but it supposed to be only one term
foreach($terms as $term){
$single_template = dirname( __FILE__ ) . '/single-'.$term->slug.'.php';
}
}
}
return $single_template;
}
add_filter( "single_template", "get_custom_single_template" ) ;
$(window).scroll(function() {
if ($(document).scrollTop() > 7500 && ($("#myModalsto").attr("displayed") === "false") && (!$("#myModalsto").hasClass('shown'))) {
$('#myModalsto').modal('show');
$('#myModalsto').addClass('shown');
$("#myModalsto").attr("displayed", "true");
}
});