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?
- Rename “Portfolio” slug?
- Sum custom field values of particular taxonomy
- Random Default Avatar Function
- Hide wordpress field if data is empty in post!
- Change the site tagline (or similar) based on current page
- Query all posts of a custom taxonomy term
- Trouble creating conditional PHP for nav menu items with children for custom Walker
- Setting custom canonical urls
- Only show search results with if current date is between two dates?
- database interactions using OOP
- Customizer: Output default value in Customizer CSS
- How to add just one specific page to widget without plugin?
- Remove one value in dismissed_wp_pointers?
- create a select input with menus created on a custom options page
- Taxonomy linked to pages
- get_term_link() returns incorrect url
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- Create a hierarchical taxonomy list in WordPress
- Accessing data from a non-WP database/table within a page content
- Randomly Assign an Image’s Alt Text Based on Data From Post
- WordPress blog post url on category page
- Changing layout with wp_customise
- WP dynamic featured image – Can’t get second featured image url
- Converting HTML Template to WordPress Theme
- Extending the WP_Widget_Text class
- Can I prevent the user from adding more than two levels deep of terms inside of a taxonomy metabox?
- Selectbox in admin panel function linking to CSS
- Can I install/embed WordPress on a ‘single page’?
- Why my filterable portfolio page work not perfectly between slug button and slug output WORDRPESS?
- How to check if a meta value has already been assigned to any user?
- How to hide products that do not have an image from a slider carousel for an ecommerce webpage?
- Customize Theme comment template to Insert VoteUp and VoteDown buttons
- filter default query to show just selected level of child pages in wordpress
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- Grab posts by multiple categories
- Trying to build simple deposit code that hooks into woocommerce
- How to pick the default selected value in wordpress dropdown?
- How to get original custom taxonomy slug after the slug has been rewritten?
- Add New User, extra fields which are required?
- user_profile_update_errors hook not executing
- Send an email to specific adress when button is clicked?
- Customizer: active_callback and sanitize_callback incompatibility?
- Saving and Restoring a Canvas on A Individual User Basis
- Displaying custom taxonomy on WooCommerce product page
- Redirect specific user role to specific site after login?
- Send multiple attachments with wp_mail in PHP
- WordPress admin pointers tour bug?
- custom url rewrite for wordpress
- Extend plugin Class through functions.php
- How to add a do_action on refreshing of WP customizer?
- How to split links generated into an xml sitemap to avoid exceeding 30 sec maximum execution time?
- Customize position of social icons in upme plugin [closed]
- Weird 404 URL Problem – domain name being placed at end of urls
- How to get the value of input hidden html from text editor to custom page template?
- Make a list of sites for each user in WPMU – switch_to_blog (display in SITE_ID: 1)
- Menu jumping when calling it via PHP
- How to get post’s current parent term ID?
- Output Video Download Link in template
- Modify custom field input data before creating a new post
- Output custom field value to post string
- multiple taxonomy select display only one in front end
- Display parent and child taxonomies in separate drop down select fields
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
- Media Upload , file name changed automatically
- Replace shortcode in substring
- Custom posts in different columns style
- How to show only subcategories in parent category not parent category?
- Need help enqueueing webfonts
- Custom field values to taxonomy terms
- How do I add a custom css to all posts without affecting homepage css? [closed]
- how to show only specific category for a template
- Custom Background by Page IDs
- Pull Tags But Not as Links
- Advanced Custom Fields not displaying
- How to get private property in parent class into extended class?
- How to obtain the current website URL in my theme?
- What exactly do this function declared into functions.php file of a WP theme?
- “operation successful” message
- Exclude posts with specific metadata from search?
- Change order of custom submenu link in WP Admin?
- Underscore – Self hosted fonts
- Copy taxonomy terms from one post to another programmatically
- I’m trying to create an array with a foreach loop, but the array only stores the last item [closed]
- Hook called before text widget save
- 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]
- Clickable image link sends people to wrong URL
- customize wordpress database error page
- Display Youtube Time Automate from Key
- Echo title attribute php
- working with term_relationships table
- How to fix this PHP warning in WP-Admin after upgrading to 3.1.2?
- Function Reference Documenting Template Tags for use in Custom Theme Templates?
- How to filter custom taxonomy term name, slug, and description?