Thursday, June 23, 2022
HomeWordPress Developmentwp question - Customized submit sort loop with customized class filtering

wp question – Customized submit sort loop with customized class filtering


Is that class or customized taxonomy?

if it is a class, then do that one.


<?php
$loop = new WP_Query(
array(
    'post_type' => 'portfolio',
    'posts_per_page' => 50,
    'category__in' => array('8','9','10'), // your class ids
)
);
whereas ( $loop->have_posts() ) : $loop->the_post();

?>

<div class="half-column">
<h2><?php the_title(); ?></h2>
</div>

<?php endwhile;
wp_reset_postdata();
?>```


Or if this tradition taxonomy, do that one

```php

<?php
$loop = new WP_Query(
array(
    'post_type' => 'portfolio',
    'posts_per_page' => 50,
    'tax_query' => array(
        array (
            'taxonomy' => 'yourTaxonomy',
            'discipline' => 'slug', //sort, id or slug
            'phrases' => 'yourTermSlug',
        )
    ),
)
);
whereas ( $loop->have_posts() ) : $loop->the_post();

?>

<div class="half-column">
<h2><?php the_title(); ?></h2>
</div>

<?php endwhile;
wp_reset_postdata();
?>

let me know the replace.
Thank You

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments