Displaying event posts as regular posts (advanced)
-
Hello and congrats on this marvellous plug in. Im not exactly a php expert, but I can work some things out so please bare with me.
I am using a theme which features a “megamenu” (article previewsd displayed on menu hovering) and all sorts of goodies and is compatible with CPT as long as they are registered as normal “category” taxonomy. What I have done up to now, is disable the “event categories” and “event taxonomies” – in my theme’s functions.php file I have added the following:
add_action('init', 'soft_add_default_boxes'); function soft_add_default_boxes() { register_taxonomy_for_object_type('category', 'event'); register_taxonomy_for_object_type('post_tag', 'event'); }My event posts, are all correctly displayed as “normal” posts everywhere in the site – in latest posts widgets, and even in “normal” category page (not EM categories).
Thus, I have created a normal category “events” and every CPT “event” I post, I assign it the category “events” and everything is good.
I have also created the files
category-events.php
single-event.php
so I can have a better overall control of what is displayed when I visit these posts.The problems:
1.In the page website.com/category/events (thus, when category-events.php file is used) the events are displayed in the order they were publicized, not in the order of “upcoming events”. Ideally, I would like to order them from the most soon upcoming to the most far away in the future, and exclude the “past” events. I know I could use a custom page – template and the shortcode for events list the plug in provides but for the reasons I explained initially I need to stay in the normal category displaying of my theme.
Is there a php code I can include in category-events.php to achieve what Im after?2. In the “megamenu” system of my theme, under the “events” category, the CPTs “event” are correctly displayed, BUT isntead of the modified “date of event” which is displayed on every single EM CPT post, I get the initial “publish date”. Is there a way to fix this too, provided have no problem editing core functionalities of my theme?
I understand my issues are particularly connected to my implementation of EM as a “normal” post and perhaps are outside the scope of your support – any info, hints, or general guidance would be greatly appreciated.
Thanks and sorry for the long post.
The topic ‘Displaying event posts as regular posts (advanced)’ is closed to new replies.