);
$newposts = get_posts($newargs);
$newvariable = 0;
$newcount = 0;
$newvotes = 0;
foreach ($newposts as $post) {
$all = get_post_meta($post->ID, 'vote_total', true);
$rating = get_post_meta($post->ID, 'vote_rating', true);
if ($all != 0) {
if (!is_nan($rating / $all)) {
$newvariable += $rating / $all;
$newcount += 1;
$newvotes += $all;
}
}
}
$context['sumrt'] = round($newvariable / $newcount, 1, PHP_ROUND_HALF_UP);
$context['votesrt'] = $newvotes;
$context['sumpr'] = round(round($newvariable / $newcount, 1, PHP_ROUND_HALF_UP) * 20, -1);
// Суммарный
#Добавляем для получения значений
$category = get_queried_object();
$dwbuttons = carbon_get_term_meta($category->term_id, 'dwbuttons', 'complex');
//var_dump($dwbuttons);
if ($dwbuttons) {
//$context['dwbuttons'] = "Массив содержит данные";
$dwbuttonshtml = '<div class="dwbuttonslist">';
$dwbuttonshtml .= '<div class="item-dwbutton title-dwbutton">';
$dwbuttonshtml .= '<span>Скачать Minecraft Бесплатно: Самая Последняя Версия</span>';
$dwbuttonshtml .= '</div>';
foreach ($dwbuttons as $dwbutton) {
$dwbuttonshtml .= '<div class="item-dwbutton">';
$dwbuttonshtml .= '<div class="item-dwbutton-l">';
$dwbuttonshtml .= '<span>';
);
$newposts = get_posts($newargs);
$newvariable = 0;
$newcount = 0;
$newvotes = 0;
foreach ($newposts as $post) {
$all = get_post_meta($post->ID, 'vote_total', true);
$rating = get_post_meta($post->ID, 'vote_rating', true);
if ($all != 0) {
if (!is_nan($rating / $all)) {
$newvariable += $rating / $all;
$newcount += 1;
$newvotes += $all;
}
}
}
$context['sumrt'] = round($newvariable / $newcount, 1, PHP_ROUND_HALF_UP);
$context['votesrt'] = $newvotes;
$context['sumpr'] = round(round($newvariable / $newcount, 1, PHP_ROUND_HALF_UP) * 20, -1);
// Суммарный
#Добавляем для получения значений
$category = get_queried_object();
$dwbuttons = carbon_get_term_meta($category->term_id, 'dwbuttons', 'complex');
//var_dump($dwbuttons);
if ($dwbuttons) {
//$context['dwbuttons'] = "Массив содержит данные";
$dwbuttonshtml = '<div class="dwbuttonslist">';
$dwbuttonshtml .= '<div class="item-dwbutton title-dwbutton">';
$dwbuttonshtml .= '<span>Скачать Minecraft Бесплатно: Самая Последняя Версия</span>';
$dwbuttonshtml .= '</div>';
foreach ($dwbuttons as $dwbutton) {
$dwbuttonshtml .= '<div class="item-dwbutton">';
$dwbuttonshtml .= '<div class="item-dwbutton-l">';
$dwbuttonshtml .= '<span>';
}
break;
}
}
if ( ! $template ) {
$template = get_index_template();
}
/**
* Filters the path of the current template before including it.
*
* @since 3.0.0
*
* @param string $template The path of the template to include.
*/
$template = apply_filters( 'template_include', $template );
if ( $template ) {
include $template;
} elseif ( current_user_can( 'switch_themes' ) ) {
$theme = wp_get_theme();
if ( $theme->errors() ) {
wp_die( $theme->errors() );
}
}
return;
}
<?php
/**
* Loads the WordPress environment and template.
*
* @package WordPress
*/
if ( ! isset( $wp_did_header ) ) {
$wp_did_header = true;
// Load the WordPress library.
require_once __DIR__ . '/wp-load.php';
// Set up the WordPress query.
wp();
// Load the theme template.
require_once ABSPATH . WPINC . '/template-loader.php';
}
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define( 'WP_USE_THEMES', true );
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';