Implement post query in specific block to use custom taxonomies

Posted in: Newspaper
Post count: 101

Hello.

I have spent the past days trying to find a way to be able to filter my posts based upon category and custom taxonomy.
Since tagdiv sadly doesn’t support custom taxonomy filtering, I was hoping that adjusting a block might do the trick.

is it possible to perhaps make 26 copies of block 10 and module 10 (doable with the api plugin example on your site https://forum.tagdiv.com/practical-example-how-to-add-a-new-block-and-module/)
for instance block 10 A, block 10 B,.. to make an alphabetical index ?

I’d then adjust the post loop to only include posts from that taxonomy, whereas the filter in the tagdiv composer could then be set to the different categories (movies, music etc).

could you tell me if this is doable and where this query can be adjusted ?
I’ve followed literally all links you post in the replies stating have a look here, but they are always outdated or incomplete as an answer.

this is the loop argument that I’d like to include in the blocks:

$args = array(
'post_type' => 'post',
'posts_per_page'         => '-1',
'meta_key'			=> 'keyword',
'orderby'			=> 'meta_value',
'order'				=> 'ASC',
'tax_query' => array(
    'relation' => 'AND',
    array(
        'taxonomy' => 'alphabetical_letter',
        'field'    => 'term_id',
        'terms'    => array( '441' ), //this is by slug
    ),
    array(
        'taxonomy' => 'category',
        'field'    => 'slug',
        'terms'    => array( 'muziek-recensies' ), //this is by id
    ),
),

);

// The Query
query_posts( $args );

// The Loop

if (have_posts()) {
    while ( have_posts() ) : the_post();
        echo $td_template_layout->layout_open_element();

        if (class_exists($td_module_class)) {
            $td_mod = new $td_module_class($post);
            echo $td_mod->render();
        } else {
            td_util::error(__FILE__, 'Missing module: ' . $td_module_class);
        }

        echo $td_template_layout->layout_close_element();
        $td_template_layout->layout_next();
    endwhile; //end loop
    echo $td_template_layout->close_all_tags();

Post count: 23312

Hello NickDeBaerdemaeker,

Unfortunately, the theme does not have any such an option. You should do it yourself through the code because this task involves doing such additional customizations and we cannot provide something like this at the moment, sorry! Usually, we recommend the developers from studio.envato.com

Thanks for your understanding!

Post count: 29

Nick, did you manage to find a way to filter by custom taxonomy? This is a feature I’m looking for a long time.

Post count: 101

yes and no, depends really.

No, if you want to filter the posts via the tagdiv composer. That option is really missing and much needed for what we wanted to do but sadly I’m no expert coder so I failed for 3 weeks straight.

Yes, but this was only for our alphabetical index we have used the posts table pro plugin which did the job perfectly.
https://barn2.co.uk/wordpress-plugins/posts-table-pro/

It allows filtering with taxonomies but I’m not sure if it would work with displaying full posts.

have a look, who knows it might be what you need.

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.