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
- $wp_query->queried_object->ID throws warning: Undefined property
- The Operator “NOT IN” Does Not Work In tax_query
- How to get_queried_object on multiple objects?
- Displaying Posts Related to Other Posts by a Taxonomy Term?
- How to get the parent’s taxonomy?
- Help with hierarchical custom taxonomies and permalinks…almost there
- custom post type paging not working past page 3
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- Query for posts in 2 taxonomies
- Optimised Code for Pulling Taxonomy Posts
- Calculating Bayesian average for custom post type
- How to filter custom taxonomy categories on archive?
- WordPress Orderby Numeric Value Not Working
- Custom Post Type Loop within Shortcode
- Fetch taxonomies by custom post type id array
- Display CPT posts based on specific taxonomy
- shortcode to show custom post types by category
- 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?
- Genesis filterable portfolio isotope [closed]
- convert custom query to wp_query
- Get custom taxonomies from multiple posts
- Making certain categories of CPT not publicly queryable
- 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
- WP_Query inside foreach loop returning same value for all options when filtered using ajax
- How can I made custom taxonomies relationship?
- Specific query for custom post type
- Custom taxonomies relationship
- Display post content with respect to its title?
- Prioritize posts in query by meta keys?
- Different Ways to Query Custom Post Types?
- Why is my WP_Query outputting my entries twice?
- How to display Related Posts based on number of taxonomy terms matched
- 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
- Variable not working in WP_Query
- WP_query – Filter by tax_query and meta_query using multiple select
- Wp Query with multiple custom tag(taxonomy) by get the terms
- how to get this tax_query working?
- How to sort a WP_Query by a custom field AND ALSO filter by a different custom field
- Query not work for current taxonomy
- Display a post from custom post type only if all the selected taxonomies and custom field value matches the record
- How to get the post terms from a child taxonomy
- 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?
- Get posts by category name
- Custom types, taxonomies and query optimization
- Display featured posts for a custom post type by taxonomy
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- What is the most efficient way to execute recursive complex queries?
- How to divide Subcategories into pages of parent category wordpress
- set object terms after some some time of published post – functions.php
- Change search query in wordpress custom post type
- Sort custom posts by date and then by taxonomy
- WP Query: If field X is empty, show posts based on field Y
- Is there a way to use ‘publicly_queryable’ => false only on specific taxonomy term?
- display post count in archive page that have relation with another taxonomy term
- Displaying all posts by category and showing content on click
- How to search through all child taxonomies using WP_Query?
- How select query is generated in a Custom Post Type?
- WP_query sort by taxonomy
- Custom Taxonomy – fields
- CPT Loop, include taxonomies and disclude others?
- Linking posts together with Advanced Custom Fields “both ways”
- Why get_posts() returns empty array while I am trying to get posts from some specific taxonomies and work properly with others?
- Conditional posts in WP_query for search
- Checking Taxonomy Terms for a Custom Post Type With get_the_terms Not Working
- Custom post type and custom taxonomies display
- WP_Query for CPT with filter by another WP_Query
- Is it possible to add query parameters on the archive page?
- How to pass taxonomy terms to WP_Query along with $args?
- WordPress custom post type
- Custom Taxonomy Query by Taxonomny not working
- How to query posts by meta keys AND under specific category?
- Shortcode display CPT Query only showing 1 post?
- Query Only Show Text on Posts With Certain Taxonomy Tag
- Storing/querying custom date data
- Query child posts on parents single.php?
- Query Posts From Multiple Post Types
- WP Query Post Type with same Taxonomy name
- WordPress can only query up to 766
- Listing custom post type items from a couple of custom taxonomies
- Sort ACF by custom taxonomy
- Query custom post type and group by taxonomy
- Dynamically count the number of custom post types associated to a custom taxonomy