function get_seo_instead_title() {
if ( is_single() ) {
if ( get_post_type() === 'route' ) {
$roads_subtype = get_post_meta(get_the_ID(), 'subtype', true );
if ( $roads_subtype == 'bus' ) {
return 'Расписание автобусов ' . get_the_title();
} else {
return 'Расписание маршрутов ' . get_the_title();
}
}
}
}
function get_seo_before_title() {
if ( is_tax() ) {
if ( is_tax( 'routes' ) ) {
return 'Справочник маршрутов города ';
}
}
}
function get_seo_after_title() {
if ( is_single() ) {
if ( get_post_type() === 'platform' ) {
return ' — маршруты и расписание транспорта';
}
}
}
// %%BeforeTitle%% %%title%% %%AfterTitle%%
// %%BeforeTitle%% %%term_title%% %%AfterTitle%%
// define the action for register yoast_variable replacments
function register_custom_yoast_variables() {
wpseo_register_var_replacement( '%%BeforeTitle%%', 'get_seo_before_title', 'advanced', 'Some before title text' );
wpseo_register_var_replacement( '%%AfterTitle%%', 'get_seo_after_title', 'advanced', 'Some after title text' );
wpseo_register_var_replacement( '%%InsteadTitle%%', 'get_seo_instead_title', 'advanced', 'Some instead title text' );
}
// Add action
add_action('wpseo_register_extra_replacements', 'register_custom_yoast_variables');
get_the_ID()
, get_the_title()
, get_post_meta()
и т.д. Общие шаблоны находятся в соседних вкладках того скриншота, который вы показываете - Типы содержимого и Таксономии div[v-cloak] {
display: none;
}
function mytheme_customize_register( $wp_customize ) {
$wp_customize->remove_section( 'title_tagline');
$wp_customize->remove_section( 'colors');
$wp_customize->remove_section( 'header_image');
$wp_customize->remove_section( 'background_image');
$wp_customize->remove_panel( 'nav_menus');
$wp_customize->remove_section( 'static_front_page');
$wp_customize->remove_section( 'custom_css');
}
add_action( 'customize_register', 'mytheme_customize_register', 99 );
<?php $args = array(
'cat' => 4,
'orderby' => 'rand',
'posts_per_page' => 1 // сколько вам нужно рандомных постов
);
$query = new WP_Query($args);
?>
<?php if ($query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>
<a href="<?php $custom_fields =get_post_custom(); ?>">
<?php the_post_thumbnail(); ?>
<div class="text">
<h2><?php the_title(''); ?></h2>
<p><?php the_content('',true); ?></p>
</div>
</a>
<?php endwhile; ?>
<?php endif; ?>
global $product;
// если товар вариантивный
if ($product->is_type( 'variable' ))
{
//получаем варианты
$available_variations = $product->get_available_variations();
foreach ($available_variations as $key => $value)
{
/**
* Тут выводишь то что должно быть в списке вариаций.
* Ссылку на добавление вариации товара в корзину в самом простом случае
* можно сделать так: http://host.com/?add-to-cart=xxx, где xxx - это ID варианта
**/
}
}
class My_Widget_Price_Filter extends WC_Widget {
function register_price1_widget() {
register_widget( 'My_Widget_Price_Filter' );
}
add_action( 'widgets_init', 'register_price1_widget' );
require get_template_directory() . '/inc/price-widgets.php';
<input id="priceMin" name="min_price" class="min_price" value="5000"> -
<input id="priceMax" name="max_price" value="15000" class="min_price">
echo get_field( 'little-text', 'products_category_' . get_queried_object_id() );
Также не откажусь от альтернативных вариантов вывода 2х разных текстов на странице архива.