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
- How to create a three column blog layout with a single query and with three different classes?
- Using pre_get_posts with WP_Query
- WP_Query + random
- Search custom taxonomy term by name
- Function in array as arguments for WP_Query
- Getting an array out of WPQuery
- WP_Query with meta_value LIKE ‘something%’
- All-in-One Event Calendar: Custom Query – Getting each event Instance [closed]
- WP_Query inside an existing wp_query stops next post showing
- Set div columns in a loop by post count
- cloning a WP_Query
- Get posts using WP_Query
- How is WP_Query connected to WP_Post in The Loop?
- How to display the modified post today
- Mysql query LIKE not working
- Multiple taxonomy And acf filter group by
- Get number of authors
- Take all produts by category
- How can I display a custom field from all posts and order them individually from their parent post
- meta_query not working as expected
- WordPress Blog Posts with Pagination inside a Page/Post
- exclude a post from wp_query loop
- Is_single() conditional tag returns null in query
- Limit home post to 10 without creating pagination?
- Is it possible to query a custom field where the value is between two fields?
- WP_Query Meta_key is text value and need to sort as numeric not working
- filter wp_query result with custom field values
- Create a page template for “top rated posts” but show full content and not just a list
- Why tax_query in WP_Query not working
- construct complex queries with WP User Query
- Add URL Rewrite Rule To WordPress
- localizing variable on front-page.php template fails but succeeds on single page and taxonomy archive
- Remove from array in WP_Query loop
- How can I detect if the current post is in this loop?
- wpquery via ajax
- Pagination problem by using WP_Query
- Where is this query?
- How to merge multiple foreach into 1 foreach and sort by date
- Custom Taxonomy – Modify Function to Get Child Category
- Why does my output of get_the_ID() change after a wp_query?
- WP Query works outside a function, not inside a function
- Pull posts from all categories if quantity is not met?
- Query_post 5 post first / last of post_id
- Multiple tax_queries: display posts titles from several custom taxonomie
- Using URL variables on a custom WP_Query
- How to query images from a post to use in a slider
- Show parent’s child and also child’s, child on a page?
- Fire query on ajax post url page
- What is wrong with this pagination code?
- how to add limit records in wordpress query
- query only direct child and sub-terms of a current term archive
- WP_Query by meta key not returning any posts