I’m not sure if you are looking for a Taxonomy query… or a way to get terms, does one of these solutions answer your question. Please don’t downvote as I am going of very limited information and guessing here at what you need.
<?php
$args = array(
'post_type' => 'post-type',
'posts_per_page' => 5,
'tax_query' => array(
array(
'taxonomy' => 'taxname_tax',
'field' => 'slug',
'terms' => 'term-to-query'
)
)
);
$listing_query = new WP_Query($args);
?>
<?php if ( $listing_query->have_posts() ) : while ( $listing_query->have_posts() ) : $listing_query->the_post(); ?>
<?php the_title(); ?>
<?php endwhile; endif; // end of taxonomy query loop. ?>
<?php wp_reset_postdata(); ?>
// or a taxonomy lookup
<?php $terms = get_the_terms( $post->ID, 'taxonamy_tax' ); ?>
<?php foreach( $terms as $term ) echo $term->slug; ?>
Related Posts:
- Software for WordPress Theme and Plugin Development? [closed]
- How to detect mobile devices and present them a specific theme?
- Using wp_add_inline_style without a stylesheet
- Reset positions of metaboxes in admin
- Add a dropdown to theme customizer
- design and development workflow
- enqueue script for specific shortcode
- The difference between calling wp_enqueue_scripts to load scripts and styles in custom theme
- WordPress twentytwenty theme inline css overriding css body
- What is the problem if I use CDN in my WordPress parent theme(built using bootstrap)?
- How can I insert default widgets when my theme is activated (similar to what twenty eleven does)?
- add generated stylesheet from parent theme after child-themes style.css
- date_i18n() issue
- Active theme responds to theme change request to alert user
- How to check if post has any tag?
- LOST in WP Template Hireachy
- Merging PHP download script into `functions.php`
- Should use widgets in this case?
- Changing the entire control choices using wp.customize with JavaScript
- Static Front Page problem
- Enabling Default Widgets in a Custom Theme
- A theme that follows all the best practices to learn from?
- get_post() function returns post even if it is trashed
- There’s an image named g.gif somewhere in my WordPress site
- WordPress how to override function adjacent_posts_rel_link_wp_head() in link-template.php the correct way
- Can wordpress run in root of existing php site with no theme on index.php but all other WP posts/pages?
- How to regenerate thumbnails when they’re stored on S3
- customizing the_password_form filter
- Whats the safest way to output custom JavaScript and Css code entered by the admin in the Theme Settings?
- CSS won’t style output of wp_nav_menu() correctly
- WordPress 404 page returning with default in IIS7
- searchform.php override not working
- Can’t show custom post thumbnail sizes as background images
- Load child template based on parent
- How to make the_tags title translatable?
- Theme translation not applying
- How to add filter the post thumbnail before save in database?
- Set default featured image for terms of a custom taxonomy
- Custom theme development additional pages
- How to add material design css in wordpress and woocommerce
- Timber: Get single image from media library with all attributes
- changing blog title to an image using filter function in child theme
- page.php dependent sites are not working in custom woocommerce theme
- WordPress taxonomy and archive custom class
- What is the meaning of WordPress’s recommended css classes and where are they applied?
- Would to use AJAX to get an option from the database and use it in a jquery setup or is there an alternative to consider?
- How to remove text “Log In” from login page
- Website pagespeed problem
- Why wp_nav_menu() doesnt show the proper meny when invoked two consecutive times?
- ACF Pro make URL Linked in Custom Template [closed]
- Managing WordPress Theme
- Can’t use admin_enqueue_scripts or wp_enqueue_script
- How is the `get_sidebar` function meant to be used to call a 2nd sidebar?
- next_posts_link and previous_posts_link problem
- Data Validation in wordpress
- Gutenberg theme development: how to add “headers” option under styles > colors > elements?
- Localize script not working in ajax
- How to find and remove unnecessary theme scripts? [closed]
- How can i make multilevel menu in wordpress theme with bootstrap
- Theme logo metadata into template file
- Remove div element generated automatically from theme [closed]
- Setting conditional background image from meta value
- How to Emulate Default Navigation Menu Behaviour in a Custom Theme?
- How to use the _S framework
- How to link to the page displayed by home.php?
- How to make excerpt image be full size instead of thumbnail?
- WordPress comments title
- How can I run code in functions.php when switch_theme() is called?
- How to get a random single category name in get_posts()?
- Ensure SQL changes carry over
- Custom themes that won’t work when theme is changed
- only the first post is shown
- wordpress can’t find single-project page
- Show Yoast SEO meta tags in Custom WordPress Templates (Theme)
- Is there a way to add classes to a page when using a Gutenberg reusable block as page layout?
- How to show some of category in wordpress
- using themename_the_custom_logo() in template-tags?
- How to make the media library searchable by image title
- WordPress doesn’t load css, image and js files after moving local installation folder
- How do I build a WordPress Profile/Author Header?
- Custom page template not showing on page creation
- Create settings field on button click
- Undefined index: custom_sidebars
- How To Customise WordPress Comment Submit Button?
- Next/Previous post navigation
- Single Featured Image Repeating
- How to remove menu from WP-Admin menu
- Main Menu Theme Different Output Print
- apply_filters to featured image
- How do I move menu to the bottom in Custom Community theme?
- How do I get information about a page, such as featured image, except, and title?
- How can I install my custom-made theme on a wordpress.com blog? [closed]
- IS there any reason not to include javascript in my own post’s embeds?
- How to create more templates to the same theme?
- A problem in loading index.php
- .submenu class missing in output from wp_nav_menu
- Creating image grid on products page in wordpress
- Insert gutenberg blocks into template
- What is the point of using archive.php instead of index.php?
- How to make it so I can “use” template parts in (classic/full) site editor