Title: Slider &#8211; Code Suggestion
Last modified: August 24, 2016

---

# Slider – Code Suggestion

 *  [melmo](https://wordpress.org/support/users/melmo/)
 * (@melmo)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/slider-code-suggestion/)
 * Hi,
 * First, thanks for a great plugin that I’ve used on many sites for several years.
 * I’ve had an ongoing problem with the slider though. When you do a tax query, 
   it defaults to only searching for posts, and so if there are custom posts with
   that taxonomy tag, they aren’t returned. This can be quickly fixed by editing
   the files shortcodes-ultimate/inc/core/tools.php on line 718 or so to change:
 *     ```
       // Source: taxonomy
       		elseif ( $args['source']['type'] === 'taxonomy' ) {
       			// Parse taxonomy name and terms ids
       			$args['source']['val'] = explode( '/', $args['source']['val'] );
       			// Taxonomy parsed incorrectly, return empty array
       			if ( !is_array( $args['source']['val'] ) || count( $args['source']['val'] ) !== 2 ) return $slides;
       			$query['tax_query'] = array(
       				array(
       					'taxonomy' => $args['source']['val'][0],
       					'field' => 'id',
       					'terms' => (array) explode( ',', $args['source']['val'][1] )
       				)
       			);
       		}
       ```
   
 * to
 *     ```
       // Source: taxonomy
       		elseif ( $args['source']['type'] === 'taxonomy' ) {
       			// Parse taxonomy name and terms ids
       			$args['source']['val'] = explode( '/', $args['source']['val'] );
       			// Taxonomy parsed incorrectly, return empty array
       			if ( !is_array( $args['source']['val'] ) || count( $args['source']['val'] ) !== 2 ) return $slides;
       			$query['tax_query'] = array(
       				array(
       					'taxonomy' => $args['source']['val'][0],
       					'field' => 'id',
       					'terms' => (array) explode( ',', $args['source']['val'][1] )
       				)
       			);
       			$query['post_type'] = 'any';
       		}
       ```
   
 * [https://wordpress.org/plugins/shortcodes-ultimate/](https://wordpress.org/plugins/shortcodes-ultimate/)

The topic ‘Slider – Code Suggestion’ is closed to new replies.

 * ![](https://ps.w.org/shortcodes-ultimate/assets/icon-256x256.gif?rev=2547563)
 * [Shortcodes Ultimate - Content Elements](https://wordpress.org/plugins/shortcodes-ultimate/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shortcodes-ultimate/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shortcodes-ultimate/)
 * [Active Topics](https://wordpress.org/support/plugin/shortcodes-ultimate/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortcodes-ultimate/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortcodes-ultimate/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [melmo](https://wordpress.org/support/users/melmo/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/slider-code-suggestion/)
 * Status: not resolved