Hello I wanted to add the possibility to restrict the slideshow Accordion to a certain custom post type.
Therefore I copied the “slideshow_accordion.php” into my child theme and added the following in the code:
However, the short code does not seem to be evaluated. The accordion is displayed but with the standard post types.
I have looked at the $config variable in the constructor and the variable post type is simply not set here. I guess I missed a place between parsing and instantiating the object. I would be grateful for a hint.
Hey cwinkens,
Thank you for the inquiry.
It is probably not working because the taxonomy query overrides the post_type parameter. To fix it, try to unset the taxonomy query when the post_type parameter is set in the query_entries function of the aviaaccordion class. Also, make sure that post_type is actually available as an attribute.
The query can be found around line 1200 and the post_type check can be done above that line.
$query = array( 'orderby' => $orderby,
'order' => $order,
'paged' => $page,
'post_type' => $params['post_type'],
// 'post_status' => 'publish',
'offset' => $params['offset'],
'posts_per_page' => $params['items'],
'post__not_in' => ( ! empty( $no_duplicates ) ) ? $avia_config['posts_on_current_page'] : array(),
'meta_query' => $meta_query,
'tax_query' => $tax_query,
'date_query' => $date_query,
);
Best regards,
Ismael
