без плагинов
define( 'CUSTOM_USER_TABLE', $shared_table_prefix . 'my_users' );
define( 'CUSTOM_USER_META_TABLE', $shared_table_prefix . 'my_usermeta' );
$term = get_queried_object();
$term_slug = $term->slug;
$_posts = new WP_Query( array(
'post_type' => 'works',
'posts_per_page' => 10,
'tax_query' => array(
array(
'taxonomy' => 'category', // или вашу таксономию
'field' => 'slug',
'terms' => $term_slug,
),
),
) );
if ( $_posts->have_posts() ) :
while ( $_posts->have_posts() ) :
$_posts->the_post();
get_template_part( 'works-item' );
endwhile;
endif;
wp_reset_postdata();
<?php if(function_exists('the_ratings')) { the_ratings(); } ?>
theme_options
: www.onwordpress.ru/stranicu-nastroek-temy-v-admink... Может кто знает действенное решение данного недуга.
add_filter( 'wpcf7_form_elements', 'do_shortcode' );
function hello_world_cf7_func() {
return "Привет! Я шоркод для Contact Form 7!";
}
add_shortcode('hello_world', 'hello_world_cf7_func');
//----------------------------------------------------------------
add_filter('wpcf7_mail_components', 'do_shortcode_mail', 10, 3);
function do_shortcode_mail( $components, $contactForm, $mailComponent ){
if( isset($components['body']) ){
$components['body'] = do_shortcode($components['body']);
}
return $components;
}
<?php
// Получаем слово в скобках [], чтобы идентифицировать его
// и сделать ссылкой;
preg_match("/\[[^\]]*\]/", $old_text, $word_in_brackets);
if (isset($word_in_brackets[0])) {
$word_not_brackets = trim($word_in_brackets[0], '[');
$word_not_brackets = trim($word_not_brackets, ']');
$strRpl = str_replace($word_in_brackets[0], '<a href="/?s='. $word_not_brackets .'" target="_blank">'. $word_not_brackets .'</a>', $old_text);
echo $strRpl;
}else{
echo $old_text;
}
?>
'wpautop' => true
'args' => array(
'wpautop' => true,
'teeny' => false,
'quicktags' => false,
'textarea_rows' => 10
)
$fpabouttext = $webcorp_options['fp-about-text'];
echo wpautop($fpabouttext);