Display post count for a specific month

here is correct answer if someone need $aprel = get_queried_object(); /////////////////////////////////////////////////// $aprelpost = array( ‘post_type’ => ‘sikayet’, ‘post_status’=>’publish’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘sectors’, ‘field’ => ‘slug’, ‘terms’ => $aprel->slug, ), ), ‘date_query’ => array( ‘year’ => 2021, ‘month’ => 3 ) ); $aprelpost_query = new WP_Query ( $aprelpost ); $ap … Read more

Error 404 change permalink term custom term taxonomy

If you just want the category permalink be in the form of: example.com/products/category/<category slug>, then you don’t need to hook on term_link. Instead, you could just set the taxonomy’s rewrite slug to products/category and you would also register the taxonomy first then followed by the post type. That way, WordPress would see the request (at … Read more

Search CPT by tag ids

I have done by my self. Here is the solution $args = array( ‘post_type’ => ‘gampu’, ‘posts_per_page’ => -1, ‘post_status’ => ‘any’, ‘orderby’ => ‘ID’, ‘order’ => ‘DESC’, ‘tax_query’ => array( ‘relation’ => ‘OR’, array( ‘taxonomy’ => ‘my-tag-taxonomy1’, ‘field’ => ‘id’, ‘terms’ => array(30,31,34), ), array( ‘taxonomy’ => ‘my-tag-taxonomy2’, ‘field’ => ‘id’, ‘terms’ => array(30,31,34), … Read more

How to change the comments form title based on post type

You can use the comment_form_defaults filter to change your text based on custom post type. Just check the post type in your filter function. For example: add_filter( ‘comment_form_defaults’, ‘my_comment_form_defaults’ ); function my_comment_form_defaults( $defaults ) { if ( ‘my_cool_custom_post_type’ == get_post_type() ) { $defaults[‘title_reply’] == ‘My Custom Post Type Comment Title’; } return $defaults; } If … Read more

Make bootstrap 5.0 carousel dynamic using ACF and CPT UI [closed]

I found a solution: Make loop everywhere and increment i variable <!– Carousel from bootstrap–> <div id=”carouselBootStrap” class=”carousel slide” data-bs-ride=”carousel”> <?php $loop = new WP_Query(array(‘post_type’ => ‘slider_feature’, ‘orderby’ => ‘ID’, ‘order’ => ‘ASC’ )); ?> <?php if( $loop->have_posts()): $i = 0; ?> <ol class=”carousel-indicators”> <?php while ($loop->have_posts()): $loop->the_post(); ?> <li data-bs-target=”#carouselBootStrap” data-bs-slide-to=”<?php echo $i; ?>” … Read more