You should access global variables in php using global keyword.It makes variable( or object, array) visible inside current function we are dealing with. In function wms_output_home_slides you are using $post global variable directly instead access it using global keyword as following.
function wms_output_home_slides($cat) { // $cat="homeslide"
global $post;
// You Code Goes here
}
Find more information on this page.
Related Posts:
- Querying Posts by Taxonomy From Alternate Network Site
- WP_Query search posts by custom post type and custom taxonomy
- Is it possible to create a shortcode that will query a post based on taxonomies?
- Querying Term Posts in Loop
- Search / Filter posts on Title/Content OR Tags
- First custom field value (out of several) displayed twice after query
- WP_Query orderby and tax_query
- WP_Query() with custom post type and taxonomy — get all terms?
- WP_Query for custom taxonomies showing posts from non-specified terms?
- Get posts of an specific term of a custom taxonomy
- Query Pulling the same post twice
- shortcode to show custom post types by category
- Am unable to reset a query properly
- Query/list all terms and their custom post count
- Filtering WP_Query Dynamically on the Front-End
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Archive for custom taxonomy lists all posts instead of current taxonomy
- Genesis filterable portfolio isotope [closed]
- Get next and previous 3 posts in a term in single post page
- wp_query check if integer exists in custom field’s array
- convert custom query to wp_query
- Wrong request query on cpt and tax
- Get custom taxonomies from multiple posts
- Making certain categories of CPT not publicly queryable
- Pagination for Custom Taxonomy Page [duplicate]
- WP_Query most viewed posts, in multiple Post Types, last 30 days, excluding a specific taxonomy term
- Custom-Posttype & Custom Taxonomy WP_Query
- Custom loop with multiple taxonomy queries
- Return one unique custom post type result when it shares a custom taxonomy in WP_QUERY?
- Get parse_query filter to return slug instead of id
- How do I move/order posts with a tag to the end?
- Custom taxonomy rewrite give pagination 404
- WP_Query inside foreach loop returning same value for all options when filtered using ajax
- creat filter with wp_query
- Custom WP Query on custom meta and sort by multiple meta keys value
- WordPress loop: Show only a Custom Post Type Taxononmy TERM
- How can I made custom taxonomies relationship?
- What’s the WP way to load remaining custom posts?
- Specific query for custom post type
- Custom taxonomies relationship
- How to have this permalink structure: post_type/postname/custom_inner_page
- Query Custom Post Type Taxonomy term with multiple parameters
- Display post content with respect to its title?
- Prioritize posts in query by meta keys?
- Add Custom Post Type of specific Custom Taxonomy to regularly blog loop
- I am trying to hide a custom post type category to logged in users with Pre_Get_Posts
- Different Ways to Query Custom Post Types?
- Advanced search form with filters for custom taxonomies
- Why is my WP_Query outputting my entries twice?
- How to display Related Posts based on number of taxonomy terms matched
- Retrieve custom post types by custom taxonomies with WP_Query
- Showing specific post in order of array wp_query
- WP the_posts() on single-cars.php get category link
- tax_query not working in template
- Custom Taxonomy Not Showing in Front-End When Outputting a Custom Post Type with WP_Query()
- How to make WP_Query not to show irrelevant posts?
- WordPress wp_query() basic question about args
- Create an archive page for custom post type with custom taxonomy
- Using page slug in wp_query
- Custom taxonomy wp_query woes.
- Variable not working in WP_Query
- WP_query – Filter by tax_query and meta_query using multiple select
- Creating two loops based on different logic
- Wp Query with multiple custom tag(taxonomy) by get the terms
- Custom post type, custom taxonomy, query posts only from taxonomy (children of)
- WP_Query parameter conflict
- Can I query posts by taxonomy conditionally based on post type?
- how to get this tax_query working?
- Different options per post type in WP_Query
- How to sort a WP_Query by a custom field AND ALSO filter by a different custom field
- Query not work for current taxonomy
- How to show all taxonomies within custom post type loop
- Display a post from custom post type only if all the selected taxonomies and custom field value matches the record
- Returning a custom content types with meta values
- How to get the post terms from a child taxonomy
- Custom Category Walker with Image, Fallback to Most Recent Post in Category Image
- display posts of custom post type with custom taxonomy
- Custom Post Type not showing in main loop
- Custom post type and custom taxonomy 404 on page 2
- tax_query (if the terms are empty)
- How to count other posts not having specific taxonomy terms?
- Exclude latest post from WP_Query taxonomy term loop
- How to query Posts from a custom post type which contains a custom taxonomy?
- Create query for both custom post type and category
- Query Posts that have Custom Taxonomy
- List all Custom Post Type posts excluding certain Taxnomy term
- Get posts by category name
- Custom taxonomy query showing more than 4 posts
- Custom types, taxonomies and query optimization
- Foreach loop returning more than one item when querying taxonomy
- Query Custom Post by taxonomy multiple categories
- WP_Query order custom post type with certain meta key value by post modified date
- Cant’ Display Custom Post Type Title Base on Tax Terms
- Loop for custom-post-type comparing taxonomy terms for “related” posts?
- Query Custom Post Type by Taxonomy
- Display featured posts for a custom post type by taxonomy
- Multiple custom post type queries causing wrong post types to be grabbed in taxonomy + single templates?
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- Related “custom post type” using “custom taxonomy”
- What is the most efficient way to execute recursive complex queries?