/var/www/mclouds_ru_usr/data/www/mclouds.ru/wp-content/themes/mclouds/category.php
'hide_empty' => false,
));
$geographical_tags = array();
foreach ( $terms as $term ) {
$geographical_tags[] = array(
'name' => $term->name,
'slug' => $term->slug, // Слаг метки
'link' => get_term_link($term),
);
}
$data['geographical_tags'] = $geographical_tags;
while ( have_posts() ):the_post();
$data['posts'][] = get_post();
endwhile;
if ( $data['posts'] ) {
foreach ( $data['posts'] as $key => $post ) {
$post->thumbnail = carbon_get_post_meta( $post->ID, 'thumbnail' );
$post->short_description = do_shortcode(carbon_get_post_meta( $post->ID, 'short_description' ));
$post->link = get_permalink( $post->ID );
// Получаем метки
$terms = wp_get_post_terms( $post->ID, 'geographical_tag' );
if ( $terms ) {
$post->tags = [];
foreach ( $terms as $term ) {
$post->tags[] = [
'name' => $term->name,
'slug' => $term->slug, // Слаг метки
'link' => get_term_link( $term ),
];
}
} else {
$post->tags = [];
}
/var/www/mclouds_ru_usr/data/www/mclouds.ru/wp-content/themes/mclouds/category.php
'hide_empty' => false,
));
$geographical_tags = array();
foreach ( $terms as $term ) {
$geographical_tags[] = array(
'name' => $term->name,
'slug' => $term->slug, // Слаг метки
'link' => get_term_link($term),
);
}
$data['geographical_tags'] = $geographical_tags;
while ( have_posts() ):the_post();
$data['posts'][] = get_post();
endwhile;
if ( $data['posts'] ) {
foreach ( $data['posts'] as $key => $post ) {
$post->thumbnail = carbon_get_post_meta( $post->ID, 'thumbnail' );
$post->short_description = do_shortcode(carbon_get_post_meta( $post->ID, 'short_description' ));
$post->link = get_permalink( $post->ID );
// Получаем метки
$terms = wp_get_post_terms( $post->ID, 'geographical_tag' );
if ( $terms ) {
$post->tags = [];
foreach ( $terms as $term ) {
$post->tags[] = [
'name' => $term->name,
'slug' => $term->slug, // Слаг метки
'link' => get_term_link( $term ),
];
}
} else {
$post->tags = [];
}
/var/www/mclouds_ru_usr/data/www/mclouds.ru/wp-includes/template-loader.php
}
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;
}
/var/www/mclouds_ru_usr/data/www/mclouds.ru/wp-blog-header.php
<?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';
}
/var/www/mclouds_ru_usr/data/www/mclouds.ru/index.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';