Just by looking at your code I see a few places I’d investigate.
1) I don’t see any use of the $atts that come through the shortcode. Specifically the ‘tax’ and ‘post_per_page’ attributes.
So try changing this;
'tax' => '',
to this:
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => '$atts['tax']',
),
),
And same with the empty posts_per_page:
'posts_per_page' => '$atts['posts_per_page']',
Looks liek you got issue 1 fixed. Good job. 🙂
2) To fix the date issue we probably need to know how the custom field created by the events plugin is storing the event date.
EDIT: Yep. So it appears the plugin that created the custom post types also created a custom DB table. and if you are to get the event_start_date you’ll need to refer to that custom table.
Related Posts:
- How to paginate wordpress [gallery] shortcode?
- What kind of object type is WP_Query?
- Last post ordered by publish date using WP_Query on front page
- Shortcode returns escaped HTML tags
- WP_Query in a shortcode
- ‘&’ causes an error in my shortcode when I list the content of the page
- Can certain (site-crashing) limitations on WP_Query in shortcode be overcome?
- How to retrieve current page WP_Query arguments?
- wp_query add arguments using array_push if variable met
- Category attribute not working in custom shortcode
- How to get all child pages in their parent page?
- Database Queries Optimization with new WP_Query
- Orderby is working with one query but not with other
- Shortcode for latest -not expired- posts
- Gallery shortcode numerical sorting
- How to filter a query by date in a shortcode?
- How should I approach changing the template & $query as part of a shortcode’s execution?
- Shortcode Not Working in Slider When Added To Post Title
- Shortcode for custom query not returning results when attributes are added
- How to Display Shortcode in the correct location, currently displaying before content after Page Title?
- WP_query only displays one of my custom post type entries
- Assign a minimum result count for WooCommerce query shortcodes?
- Using a Shortcode to List Posts from Multiple Categories
- embedding shortcodes in php template
- How to get specific string in explode array?
- Trouble passing attribute into shortcode function
- Woocommerce Shortcode which displays a table with product data
- WP Query by 4 different taxonomies
- create custom shortcode wp and put php code in
- How to display a post(by id) along with css in a page?
- Shortcode attributes causes 500 error after updating the page
- pages shortcode filtering by category
- WP_Query & shortcode : Return 3 articles from a category WordPress
- Query by Category and Custom Field – Shortcode
- How to take parameters from a function and make them editable as attributes in a shortcode
- How to modify WP Query to target the first most recent post to adjust content
- Object of class WP_Query could not be converted to int inside shortcode
- How can I create another instance of my custom shortcode
- Get Current CPT taxonomy category in shortcode
- return wp query results in a shortcode
- More efficient query to display posts in same sub-category?
- Having Trouble Running Query From Shortcode Using Tribe’s Events Plugin
- shortcode using multiple WP_Query’s with multiple category names not fully functional
- Shortcode does not display pagination [duplicate]
- How to write a query-function as a query-shortcode?
- shortcode with $atts with strange results
- WP_query shortcode inside acf Repeater breaks the repeater loop
- How to prevent WP query searching in executed shortcodes
- Query posts only with featured image
- get_query_var function not working at all
- get_query_var( ‘paged’ ) not working outside of homepage
- Order by Category and Post in WP custom Query
- get custom post type by tag
- Using WP_Query To Get Posts Randomly From today
- How to know which one is the main query?
- WP_Query can’t exclude more than 1 author?
- How to order posts by custom WP role?
- Generate a tabbed submenu — from taxonomy term or submenu item — with sample content
- posts2posts query using connected_items array issue [closed]
- Meta query field order together with post_date order causes posts without the meta field to be unordered
- Undefined property: WP_Query::$post
- Excluding Sticky Posts from The Loop and from WP_Query() in WordPress?
- Query different number of posts with different formats in one go
- Extending woocommerce admin product search
- Pagination is broken and I need help fixing it
- How can I use $wp_query->tax_query as tax_query parameter for a new WP_Query instatiation?
- Query with search and subscribers only output
- next_post_link / previous_post_link not working with WP_Query
- Include post content of linked posts in search
- Query_posts works when appending via AJAX call wp_query doesn’t?
- How to make posts unqueryable/unpublish posts where ACF relationship field is an unpublished post? [closed]
- Get all posts with empty meta_value
- Count identical post titles
- Query by date from custom field
- pass parameters through variable to WP_QUERY
- What is wrong with my WP_Query Arguments?
- Sort posts using multiple custom fields and menu_order in single query?
- WP Query should show No Posts when tax_query $args taxonomies don’t have associated posts
- How to make WPQuery custom post type work in Twig / Timber
- get_posts return only first result
- How to allow a variable with “/” in wordpress url
- Getting posts by custom field value
- Strange results from WP_Query
- update_post_meta performance in a loop woocommerce
- Display posts side by side with custom query
- Is there a way to control both Order By and Order query parameters from one input field
- WordPress For Loop Prints Unwanted Extra Paragraph Element
- return child post if available otherwise parent post
- Custom Order Current Query: By Meta Key and Category
- WP_Query doesn’t work when url parameter is added
- why ignore_sticky_posts in sticky post query
- Woocommerce orderby rand with tax_query not random
- Select Unique Posts for a List of Tags
- WP_Query always returning the last custom post
- Featured image not showing on page
- Add filter to Orderby Parameter using Array
- Iterate through ID’s in loop
- Query string form $_GET[‘value’] is not working as meta value in wp_query
- How to retrieve _embed (etc) fields in get_posts custom query?
- Using ‘meta_query’ with the ‘pre_get_posts()’ hook disables searching for post titles