Friday, November 4, 2022
HomeWordPress Developmentmaking an attempt to show customized put up sort with customized taxonomy...

making an attempt to show customized put up sort with customized taxonomy worth by shortcode cannot works


perform register_shortcodes() {
add_shortcode( ‘traits’, ‘shortcode_sj_charcs’ );
}
add_action( ‘init’, ‘register_shortcodes’ );

perform shortcode_sj_charcs( $atts ) {
ob_start();
world $wp_query,
$put up;

$atts = shortcode_atts( array(
    'catgy' => ''
), $atts, 'traits' );

$loop = new WP_Query( array(
    'posts_per_page'    => 200,
    'post_type'         => 'traits',
    'orderby'           => 'menu_order title',
    'order'             => 'ASC',
    'tax_query'         => array( array(
        'taxonomy'  => 'characteristics_category',
        'area'     => 'slug',
        'phrases'     => array( sanitize_title( $atts['catgy'] ) )
    ) )
) );

if( ! $loop->have_posts() ) {
    return false;
}

?>

have_posts() ) {
$loop->the_post();
?>

” class=”text-white”>

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments