you can define a constant in wp.config.php or at the beginning of functions.php of your theme
if (!defined('CAROUSEL_CPT')) {
define("CAROUSEL_CPT", "post");
}
WP_Query('post_type=".CAROUSEL_CPT);//....
Related Posts:
- How do i calculate the total of values of custom fields in custom post types?
- List events by month
- Custom post type loops with different page templates
- How do you output custom code between posts in the loop?
- How to append element after thumbnail
- Display custom field of specific post where post title matches variable
- Create a random unique 6 digit number as custom field for custom post type
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Very Slow Page – How to Optimize # of Queries?
- Custom Post Type Loop throws 500 error when used in widget
- How to make sure content doesn’t display if selection is empty
- CPT + CMB2: data not displaying for only first post in loop
- I would like to have different styles for my posts based on the content of each post
- Checking if Post Title is Unique as Loop Criteria
- Custom Tag Description unable to display just below and outside of the Loop
- Get custom post type’s fields in a while loop as variables
- Including all post id’s of a custom post type into an array
- How can I group posts by months and years?
- Loop increase number
- Using wp_query to modify the loop in index.php for a CPT
- Control content before and after custom post type loop
- Custom Post not working as expected
- How to pass a variable to get_template_part that’s updated every time the template part is called?
- Get data from PHP to JavaScript to set position of each post on front page
- foreach loop inside the loop creating duplicates in output
- Compare Two Custom Post Types Using The Same Custom Taxonomy
- How can I increase the post count for custom post types only?
- Show the categories the current post has
- Fetch data from two custom post types and create multidimensional array for output to html table
- Page that lists publications by classifying them by taxonomy
- CPT loop doesn’t seem to account for post date?
- Pagination not working in custom post type. Help
- when looping through custom post data not appearing
- Accessing download link from the loop with WP Download Manager Pro
- Custom Post Type has wrong label and is not found when called by a loop
- Combine multiple separate lists into one
- Looping to organize and display custom posts by category using PHP and WordPress
- Show parent category and subcategory once in while loop
- WordPress trying to query two custom types to get child from the parent
- Add active class to foundation 6 tabs while looping categories
- Display related post content and custom field content
- WordPress loop add heading before first of type
- How to make a shortcode for my WP_Query Loop? [duplicate]
- Strange behavior on WP_query
- get_post_meta for Custom Post Type ( CPT )
- WordPress query posts by custom post type not workng
- WordPress Custom Post Type and sort by Tags
- Posts without featured image using other post’s featured image
- Order by custom field attribute
- Looping taxonomy in taxonomy?
- Query Custom Post Type by Tag
- How do I filter a custom post type loop by a field?
- WordPress Custom Post Types with a page as a parent?
- Newer/Older posts links display same posts on every page
- Limit Authors to their Own Posts on front-end excluding admins
- How to redirect all pages of a custom post type [duplicate]
- Show ACF field from custom taxonomy and display on the single template
- Loop on front-page.php
- Can’t get order_by meta_value_num to work properly
- Create custom post type on successful woocommerce order [closed]
- Creating Multiple Loops in Genesis, One Post then 20, each with custom fields
- Am unable to reset a query properly
- WordPress wrapped added a span tag to every single p tag
- How to Create Columns with WordPress and CPTUI display page ?
- Only show posts with date of today or in the future (i.e don’t show past posts)?
- How do I control the output of a custom post type in the loop?
- WP Query post__in not returning correct results
- Pagination Error : Duplicate argument being outputted
- Custon Content within WordPress Loop
- Having Issue on Ordering CPT by Custom Field In Custom WP Query
- Different options per post type in WP_Query
- How do I create a new post upon registration with the users first and last name as title
- Custom Ratings for Theme, Proper way to Refactor Code and Clean up Template File
- How to set the mainpage of a custom post type?
- Using Wp_Query, Json to add Highcharts series data
- Display the current post in browser as the first post in a loop (for a slideshow)
- Displaying One Custom Post Type’s Content On Single Post of Another Custom Post Type
- Custom post types and custom variables — add_rewrite_tag() not working
- Custom Sidebar in Editor (not Widget) for Custom Post Type in Genesis
- Loop Post Types with Name and Links
- Display all images from specific CPT
- Using page title as a link to term archive
- How to display custom post type only on a certain page?
- Setup page template array in a custom post type
- Last post in loop – custom post types
- Display category name of custom posts only once in the loop
- Change Dropdown jQuery to show/hide but with default place holder that shows all
- Get Posts List of Current Selected Custom Taxonomy in Shortcode
- Excluded Custom Taxonomy Term Posts Displaying in loop
- Do not show child pages within a file page
- Custom search for a custom post type in WordPress
- How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta
- Loop carousel slider in wordpress
- Function not pulling image or text from custom post type
- Sorting custom post types by taxonomy (So close)
- Pagination not working with custom loop
- Permalink of Custom Post Type
- How to manage wordpress knowledge base/wiki/posts collections
- Getting ACF relationship field information
- WPNavi pagination links not working on custom pages