Al262
Forum Replies Created
-
Angelo,
Thanks for the guidance, I’m in the right file now. Just a bit of coding to get what I want. I also found that I was caught by the rewrite rules too. Your advice and the link below got me moving again.
https://docs.dev4press.com/tutorial/wordpress/debug-wordpress-rewrite-rules-matching/#comment-18312You could use this code, to determine if the post is associated with the specials category. Note, I am using slug, to avoid the case and spacing issues. Then check the result set for rows.
Alternatively, if you are only looking for specials, you should modify your $sql, to include the joins and where clauses, to allow the database to restrict the result set.
SELECT e.post_id, t.name,t.slug,date_format(event_start_date,'%Y-%m') FROM test_em_events e LEFT JOIN test_term_relationships tr on (e.post_id = tr.object_id) LEFT JOIN test_term_taxonomy tt on (tr.term_taxonomy_id=tt.term_taxonomy_id) LEFT JOIN test_terms t on (tt.term_id=t.term_id) WHERE e.post_id = $row['post_id'] AND e.recurrence = 0 AND t.slug = 'specials'Lastly, Event Manager has Placeholders that may satify your needs without the coding. From the documentation set, check:
Related Events
You can show lists of other events belonging to this category. The formatting of the list is the same as a normal events list.
#_CATEGORYPASTEVENTS
Will show a list of all past events with this category.
#_CATEGORYNEXTEVENTS
Will show a list of all future events with this category.
#_CATEGORYALLEVENTS
Will show a list of all events with this category.
#_CATEGORYNEXTEVENT
Will show the next event with this category.Reviewed and resaved permalinks, no affect.
Working on my desktop (WAMP), so link is not possible.
The code snippet from the previous post will route you to the category name given a post id. Using the ID from the post you join with the term relationship table to get the term_taxonomy_id which then can be joined to the term_taxonomy table to retrieve the term_id. The term id then gives you access to the terms table, where the category names (name) is found.
This may help too, part of an event category archive widget I am working on.
SELECT t.name,t.slug,date_format(event_start_date,'%Y-%m') AS event_start,count(e.event_id) AS event_count FROM " . $wpdb->prefix . "em_events e LEFT JOIN " . $wpdb->prefix . "term_relationships tr on (e.post_id = tr.object_id) LEFT JOIN " . $wpdb->prefix . "term_taxonomy tt on (tr.term_taxonomy_id=tt.term_taxonomy_id) LEFT JOIN " . $wpdb->prefix . "terms t on (tt.term_id=t.term_id) WHERE recurrence = 0 GROUP BY t.name, event_start ORDER BY t.name ASC, event_start DESCUsing only the #_LOCATIONMAP place holder, is there a way to allow the map to resize based on the device width?