$taxonomies = array('estate_district', 'estate_type', 'estate_building_type', 'estate_operation', 'estate_class', 'estate_proprietor');
foreach ($taxonomies as $taxonomy) {
$est_cat = wp_get_post_terms($estate_id, $taxonomy, array("fields" => "ids"));
foreach ($est_cat as $cat => $cat_id) { $estate_object_data[$taxonomy] = $cat_id }
}
<?php
$needed_ids = array();
$posts = get_posts( array('category' => /* id или slug-и нужных рубрик*/) );
foreach( $posts as $post ){ array_push($needed_ids, $post->ID); }
?>
'post__in' => $needed_ids
[data-title]:hover:after {
opacity: 1;
transition: all 0.1s ease 0.5s;
visibility: visible;
}
[data-title]:after {
content: attr(data-title);
position: absolute;
bottom: -1.6em;
left: 100%;
padding: 4px 4px 4px 8px;
color: #222;
white-space: nowrap;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: 0px 0px 4px #222;
-webkit-box-shadow: 0px 0px 4px #222;
box-shadow: 0px 0px 4px #222;
background-image: -moz-linear-gradient(top, #f8f8f8, #cccccc);
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #f8f8f8),color-stop(1, #cccccc));
background-image: -webkit-linear-gradient(top, #f8f8f8, #cccccc);
background-image: -moz-linear-gradient(top, #f8f8f8, #cccccc);
background-image: -ms-linear-gradient(top, #f8f8f8, #cccccc);
background-image: -o-linear-gradient(top, #f8f8f8, #cccccc);
opacity: 0;
z-index: 99999;
visibility: hidden;
}
[data-title] {
position: relative;
}
<a href="https://toster.ru/q/564838" data-title="Телега про подводные камни в поч.. в бизнесе"> Тык </a> <br/>
wp_register_script('js_function_id', plugins_url('functions_js/js_function.js', __FILE__));
wp_enqueue_script('js_function_id');
wp_localize_script( 'js_function_id', 'ajaxurl', admin_url( 'admin-ajax.php' ) );
$my_var = $_POST['my_var'] // без всяких json_decode, stripslashes и т.д.
$data = ['surname' => $surname, 'name' => $name, 'patronymic' => $patronymic]; // и так далее
wp_send_json($data);
foreach( get_the_terms( $post->ID, 'custom_post_type' ) as $posts_id ) {
$output.= get_term_meta( $posts_id->term_id, 'meta_field', true ) . '<br>';
}
return $output;
<?php
$rait = array();
$query = new WP_Query( array( /* агументы запроса*/ ) );
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$rait += ['post_id' => get_the_id(), 'raiting' => get_post_meta( $post_id, 'like', true ) - get_post_meta( $post_id, 'dislike', true )];
}
}
// Код написан в качестве примера. Нужны правки и доработки
// Дальше цикл вывода по id-шникам в сортировкепо убыванию или возрастанию.
?>