Why that $pages
suddenly became $myposts
!!? Anyway, I really don’t see any big issues with your code, however, you can try this..
<?php
$pages = get_posts(array(
'post_type' => 'directory_listing',
'posts_per_page' => -1,
'tax_query' => array(
array(
'taxonomy' => 'place',
'field' => 'slug',
'terms' => 'place1',
'include_children' => false
)
))
);
foreach ($pages as $page) {
echo $page->post_title . '<br/>';
echo $page->post_content . '<br/>';
echo $page->slug . '<br/><br/>';
}
?>
Related Posts:
- Creating custom Woocommerce attribute taxonomies from a plugin
- Add attribute / custom attribute to product in woocommerce
- need help with existing code showing subpages
- How to separate the taxonomies list from the form so that editing taxonmies is the same as pages and posts?
- Show all terms of a custom taxonomy?
- Why have on every line
- WordPress and event-driven programming – what is it about?
- How to paginate a list of custom taxonomy terms?
- Admin Bar (Toolbar) not showing on custom PHP file that loads WordPress
- Display a selected custom product option in WooCommerce cart
- Custom post type column which compares dates?
- Set the transport of the Customizer ‘header_image’ core setting to ‘postMessage’
- Limit the Excerpt field in WP-Admin in words
- How to create different menu’s for not logged in visitors and for logged in members?
- delete an array element when its date expires
- Include a specific post to the query_posts and remove it if it is already in the returned list
- Wrap First Character after in a tag
- How do I implement a .diff changeset from core.trac.wordpress.org locally?
- get_terms orderby numeric
- Sum custom field values of particular taxonomy
- Random Default Avatar Function
- Query all posts of a custom taxonomy term
- Customizer: Output default value in Customizer CSS
- Taxonomy linked to pages
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- Create a hierarchical taxonomy list in WordPress
- Randomly Assign an Image’s Alt Text Based on Data From Post
- Converting HTML Template to WordPress Theme
- Can I install/embed WordPress on a ‘single page’?
- How to check if a meta value has already been assigned to any user?
- How to get original custom taxonomy slug after the slug has been rewritten?
- Displaying custom taxonomy on WooCommerce product page
- WordPress admin pointers tour bug?
- Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
- Custom posts in different columns style
- Custom field values to taxonomy terms
- How do I add a custom css to all posts without affecting homepage css? [closed]
- Advanced Custom Fields not displaying
- Exclude posts with specific metadata from search?
- Copy taxonomy terms from one post to another programmatically
- Add data-id attribute to child page links
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- Warning: Illegal string offset on theme options page [closed]
- Display Youtube Time Automate from Key
- working with term_relationships table
- How to fix this PHP warning in WP-Admin after upgrading to 3.1.2?
- Where is the PHP code generating an element?
- Use get() method to grab all categories and output inside another method
- Basic wpdb update question
- Check class_exists before class definition / Doxygen problem
- Extract links from content
- WordPress widget and customize.php not working in Ubuntu16.04 VPS
- fetch woocommerce product with custom taxonomy
- Custom Registration username_exists / email_exists
- How do i wrap woocomerce attribute in list?
- PHP Helper Class to create shortcodes
- Is it possible to add a custom page to a free WordPress site? [closed]
- Is there a hack for using is_page() within the function.php file?
- save metabox with new values _wp_page_template
- How to Fix an Archive.php That Displays All Posts?
- WordPress custom taxonomy
- pagination broken – clicking next displays “page not found”
- Create condition for Author bio Social Links
- WP-Bakery – Add custom colors to buttons with template colors
- How to hide a child category and show his parent category
- Woocommerce template file outputting tags
- How to update posts’ custom taxonomy selection?
- Trying to update Woocommerce meta values
- retrieve “Link Color” value
- If Statement is Ignored?
- Create “blank” admin page without having admin-bar/admin-menu for faster load
- Create Schema in WordPress with PHP
- Create form which redirects to site in network?
- Search only for posts with specific metadata?
- Building Link List for Custom Tax
- How to insert text into post based on category – via single.php file
- Get Posts by Custom Taxonomy on Custom Post
- str_replace not preserving whitespace
- How to associate dynamic PHP page for chosen WordPress tag?
- How to replace hard-coded list of custom taxonomy terms based on custom field query [closed]
- Only display notification on single post
- Is there a way to have chunks of a page’s content expire?
- Where can I find the declaration of `$_wp_theme_features`?
- Create 2-layered dropdown menus for custom taxonomy and custom post type
- Showing the project type in HREF
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- Get category id for a custom category and display it in a class
- Check if values exists DB
- if is_bbPress register jquery
- Auto create description in post
- Pagination on Custom Loop
- error with WP custom form
- How can I clear the theme mod settings?
- MySQL Engine vs. Charset
- Inserting two categories
- Date when the custom field was added
- Select area and checkbox data is not saving?
- In reading settings posts are set to “blog” and I have page-blog.php but no posts
- WP Custom tables query
- How can I change the URL via add_rewrite_rule()