Title: QUERY LOOP module does not support custom post types
Last modified: September 27, 2023

---

# QUERY LOOP module does not support custom post types

 *  Resolved [Yephy](https://wordpress.org/support/users/yephy/)
 * (@yephy)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/query-loop-module-does-not-support-custom-post-types/)
 * When the QUERY LOOP module uses taxonomies to filter articles, it cannot effectively
   display the taxonomy list for custom article types.

Viewing 10 replies - 1 through 10 (of 10 total)

 *  [fernandoazarcon2](https://wordpress.org/support/users/fernandoazarcon2/)
 * (@fernandoazarcon2)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/query-loop-module-does-not-support-custom-post-types/#post-17082077)
 * Hi [@yephy](https://wordpress.org/support/users/yephy/),
 * To clarify, do you have your CPT selected in the “Select Post Type” list in your
   Query Loop Settings?
 *  Thread Starter [Yephy](https://wordpress.org/support/users/yephy/)
 * (@yephy)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/query-loop-module-does-not-support-custom-post-types/#post-17082095)
 * Thanks Reply.
 * I created a custom post type myself using PHP code and had its own taxonomy. 
   When I use QUERY LOOP to create a post loop about a category of this custom post
   type, I have already selected this custom post type in the POST TYPE, but further“
   SELECT QUERY PARAMETER” selects the taxonomy.
 * Next, define TAXONOMIES as category, but you can only see the category list of
   the default post type in the drop-down list; you cannot see the category list
   of the custom article;
 * Going one step up, if I try to look for the taxonomy for my custom post type 
   in the “SELECT QUERY PARAMETER” list, there is none…
 *  Thread Starter [Yephy](https://wordpress.org/support/users/yephy/)
 * (@yephy)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/query-loop-module-does-not-support-custom-post-types/#post-17082126)
 * In addition, I also found a problem. When I created a new element and tried to
   replace the query list format of the website’s default search page, I set the
   ELEMENT TYPE to Loop Template, and set the “Position” to “Search Results”, and
   then added the For an H title, try to change its DYNAMIC TEXT TYPE to Title. 
   When editing in the background, the default title of the search page is displayed,
   but when I return to the front-end search page to view it, this title will become
   the first in the search results. The title of this post…how to solve it?
 *  Thread Starter [Yephy](https://wordpress.org/support/users/yephy/)
 * (@yephy)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/query-loop-module-does-not-support-custom-post-types/#post-17082204)
 * Going back to the first question, I tried to find the backend file of the plug-
   in, which is: /generateblocks/src/components/taxonomies-select/index.js. In this
   file, the following code content appears. I don’t think it is effective for itself.
   Define the taxonomy of posts to filter:
 *     ```wp-block-code
       export default function TaxonomiesSelect( props ) {
       	const {
       		taxonomy,
       		label,
       		onChange,
       		value = [],
       		help,
       		placeholder,
       		filterName = 'generateblocks.editor.taxonomies-select',
       	} = props;
   
       	const [ loadValues, setLoadValues ] = useState( value.length > 0 );
       	const [ search, setSearch ] = useDebounceState( '', 500 );
       	const isSearchById = !! search.trim() && ! search.trim().match( /\D/g );
       	const includeSearchId = isSearchById ? [ search.replace( /\D/g, '' ) ] : undefined;
       	const { records, isLoading } = usePersistentTaxonomyRecords( taxonomy, {
       		per_page: !! search ? 100 : 10,
       		search: !! search && ! isSearchById ? search : undefined,
       		include: loadValues ? value : includeSearchId,
       	} );
   
       	useEffect( () => {
       		if ( loadValues && records.some( ( tax ) => ( value.includes( tax.id ) ) ) ) {
       			setLoadValues( false );
       		}
       	}, [ JSON.stringify( records ), JSON.stringify( value ) ] );
   
       	const taxonomiesOptions = useMemo( () => {
       		const filteredTaxonomies = records
       			.reduce( ( result, tax ) => {
       				result.push( { value: tax.id, label: '#' + tax.id + ': ' + tax.name } );
       				return result;
       			}, [] );
   
       		return applyFilters( filterName, filteredTaxonomies );
       	}, [ JSON.stringify( records ) ] );
   
       	const selectedValues = taxonomiesOptions.filter( ( option ) => ( value.includes( option.value ) ) );
   
       	return (
       		<AdvancedSelect
       			id={ 'gblocks-select-author' }
       			label={ label || __( 'Select terms', 'generateblocks' ) }
       			help={ help }
       			placeholder={ placeholder || __( 'Search authors…', 'generateblocks' ) }
       			options={ taxonomiesOptions }
       			isMulti
       			isSearchable
       			value={ selectedValues }
       			onChange={ onChange }
       			isLoading={ isLoading }
       			onInputChange={ ( inputValue, { action } ) => {
       				if ( 'input-change' === action ) {
       					setSearch( inputValue );
       				}
       			} }
       		/>
       	);
       }
       ```
   
 *  [fernandoazarcon2](https://wordpress.org/support/users/fernandoazarcon2/)
 * (@fernandoazarcon2)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/query-loop-module-does-not-support-custom-post-types/#post-17082222)
 * I see. Is your custom taxonomy set to true for “Show in REST API”? If not, can
   you set it to true?
 *  Thread Starter [Yephy](https://wordpress.org/support/users/yephy/)
 * (@yephy)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/query-loop-module-does-not-support-custom-post-types/#post-17082268)
 * So talented, thank you very much!
   The first problem, the problem of custom article
   classification filtering has been perfectly solved!It was my mistake, I ignored
   the problem of Show in REST API!
 * Second question, please take a look at the issue about the abnormal title display
   after the search page is replaced!
 *  Thread Starter [Yephy](https://wordpress.org/support/users/yephy/)
 * (@yephy)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/query-loop-module-does-not-support-custom-post-types/#post-17082275)
 * This search page title seems to be called because the element type is Loop Template,
   which causes any content on the page to be included in the loop results on the
   search page, so the title can only be displayed as a loop result. The title of
   the article is not the page title of the search page!
 *  Plugin Support [David](https://wordpress.org/support/users/diggeddy/)
 * (@diggeddy)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/query-loop-module-does-not-support-custom-post-types/#post-17082471)
 * Hi there,
 * the second question is related to ( i assume ) the GP Premium Elements module.
   To provide support for that you will need to raise a topic in the premium support
   forum, link below:
 * [https://generate.support](https://generate.support)
 *  Thread Starter [Yephy](https://wordpress.org/support/users/yephy/)
 * (@yephy)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/query-loop-module-does-not-support-custom-post-types/#post-17082725)
 * OK, Thanks
    -  This reply was modified 2 years, 8 months ago by [Yephy](https://wordpress.org/support/users/yephy/).
 *  Plugin Support [David](https://wordpress.org/support/users/diggeddy/)
 * (@diggeddy)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/query-loop-module-does-not-support-custom-post-types/#post-17082878)
 * You’re welcome

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘QUERY LOOP module does not support custom post types’ is closed to new
replies.

 * ![](https://ps.w.org/generateblocks/assets/icon.svg?rev=3239461)
 * [GenerateBlocks](https://wordpress.org/plugins/generateblocks/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/generateblocks/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/generateblocks/)
 * [Active Topics](https://wordpress.org/support/plugin/generateblocks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/generateblocks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/generateblocks/reviews/)

 * 10 replies
 * 3 participants
 * Last reply from: [David](https://wordpress.org/support/users/diggeddy/)
 * Last activity: [2 years, 8 months ago](https://wordpress.org/support/topic/query-loop-module-does-not-support-custom-post-types/#post-17082878)
 * Status: resolved