$args = array(
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'movie_janner',
'field' => 'slug',
'terms' => array( 'action', 'commedy' ),
),
array(
'taxonomy' => 'actor',
'field' => 'id',
'terms' => array( 103, 115, 206 ),
'operator' => 'NOT IN',
)
)
)
$query = new WP_Query( $args );
function remove_slash($link) {
return untrailingslashit($link);
}
add_filter('term_link', 'remove_slash');
'rewrite' => true,
true (тип записи используется как префикс)
register_post_type
function create_post_type_photo () {
register_post_type( 'photo',
array(
...
'rewrite' => false
));
}
add_action( 'init', 'create_post_type_photo' );
global $wp_rewrite;
$portfolio_structure = '/portfolio/%photo%.html';
$wp_rewrite->add_rewrite_tag("%photo%", '([^/]+)', "photo=");
$wp_rewrite->add_permastruct('photo', $portfolio_structure);
add_filter('post_type_link', 'photo_permalink', 10, 3);
function photo_permalink($permalink) {
return $permalink;
}
example.com/portfolio/[photo].html
<a href="#" class="about__left_plank">
get_template_part( 'parts/about');