Tagged: magazine element
-
AuthorPosts
-
March 27, 2017 at 8:53 am #767252
Hello dear people of krisi.at,
using enfold 4.0, I tried to use the magazine element for listings of event categories from the wp events manager plugin. Actually I can choose the right taxonomy and the events are listed, but not with the event date but with the creation date, which, in this case, leads to a long list of entries with the same date, since I created them on the same date. To be able to show the event date instead of the creation date, would be most useful because I could avoid to use the somewhat unpleasant plugin’s styling tools. Instead the theme’s layout would apply. Can you please help me with a piece of code to fix this?
Greetings and thanks in advance :DMarch 28, 2017 at 12:05 pm #768071Hey RonTek,
Please use a child theme – http://kriesi.at/documentation/enfold/using-a-child-theme/ to make your changes update proof and then refer to this post – http://kriesi.at/documentation/enfold/add-new-or-replace-advanced-layout-builder-elements-from-child-theme/ and move enfold/config-templatebuilder/avia-shortcodes/magazine.php file to your child theme and then edit the file and find
$output .= "<time class='av-magazine-time updated' {$markupTime}>".$time."</time>";
and change it to
$output .= "<time class='av-magazine-time updated' {$markupTime}>".tribe_get_start_date( $entry->ID )."</time>";
Best regards,
YigitMarch 31, 2017 at 2:28 pm #769968Thank you very much. I tried it several times now and I’m afraid, it does not work. The Moment, I put the changed file to the specified folder, the Layout of my page is completely screwed up. :(
March 31, 2017 at 4:31 pm #770055Hi,
Can you please create a temporary WP admin login and FTP login and post them here privately so we can look into it? Also, please point out your testing page
Best regards,
YigitMarch 31, 2017 at 6:12 pm #770112Hi Ygit, thanks for your fast reply :)
Greetings, Andi
April 3, 2017 at 1:09 pm #771086Hi Andi,
Sorry for the late reply!
I just noticed that you are not The Events Calendar therefore the code i posted would not work. Could you please contact plugin authors and ask for the correct code to get event days?Best regards,
YigitApril 3, 2017 at 1:21 pm #771095Hello Ygit,
I’m sorry, I don’t understand your answer. I use the one, that comes with Enfold 4. This one? http://wp-events-plugin.com/about/
Best regards, AndiApril 3, 2017 at 1:26 pm #771100Hi!
It is a 3rd party plugin which is not included in Enfold. It must be installed separately by someone else if you have not installed it :)
Since i do not have much experience with the plugin, please contact plugin authorsBest regards,
YigitApril 3, 2017 at 1:31 pm #771104Oha :O…
seems, like I have screwed up something :(
So this is the one, you support with the Enfold Layout?Best Regards, Andi
April 3, 2017 at 1:49 pm #771106Hi Andi,
Yes, it is the one. You can use the free version as well – https://wordpress.org/plugins/the-events-calendar/ :)
Best regards,
YigitApril 3, 2017 at 1:54 pm #771113I am, in fact, a complete idiot :D. You can not imagine, how much work I just produced for the bin, by not recognizing I used the wrong plugin. I could scream out loud :(
Sorry for the work I caused you. I’ll come back, when I have a question regarding the new one.
Outch and thank you, AndiApril 3, 2017 at 2:02 pm #771118Hey!
No worries at all, please do not feel that way :)
If you are satisfied with the plugin you are using, you can simply contact plugin author and get the correct code to display events dates which would replace the changes i suggested here – https://kriesi.at/support/topic/events-date-in-magazine-element-not-creation-date/#post-768071In any case, if you have any other questions or issues, please feel free to contact us again :)
Cheers!
YigitApril 3, 2017 at 4:11 pm #771207Thx for your kind words. The sad thing is, I am not satisfied at all, but did not realize, I was fiddling around with the wrong software AAARGH! :D
But here is one Question regarding the Plugin “Events Calendar”
Is it possible, to take a Value like Title and Startdate and handle it to a Formfield?
I would like the customers to be able, to send a request via Email, without having to scroll through an endless list (form element: select element), when they already have chosen the right event. We need to handle the mail request with a form, because there are lots of parameters needed for a proper booking.thx in advance, Andi
P.S.: The hack from earlier this conversation (magazine element) now works fine :D
April 3, 2017 at 9:57 pm #771369Hi,
Please consider using a more advanced contact form plugin such as – https://wordpress.org/plugins/contact-form-7/. You can check out documentation for special mail tags here – https://contactform7.com/special-mail-tags/. You would be able to get the title etc. however i am not really sure if it would be possible for event dates.
Great, glad changes i recommended worked :)
Best regards,
YigitMay 30, 2017 at 8:07 pm #801651Hi Yigit,
I used the above solution for The Events Calendar and the event dates are coming in great. Thank you for the solution!Regarding a directly related issue… can you please provide instructions on how to sort the event calendar posts in the magazine element by the same criteria i.e. by event dates and not the default “creation” or “publish” date?
I have already added the ascending and descending functions to a child theme functions.php but we’re not able to select sorting by Event Calendar date criteria.
Thank you!
- This reply was modified 7 years, 6 months ago by Eric. Reason: typos
May 31, 2017 at 12:20 am #801720Hi Yigit,
One last related request… how can we modify the date format? Currently it’s only displaying the month and day. Is there an edit to the magazine.php file that will have the posts display the year as well, i.e. September DD, YYYY?Thank you!
EricMay 31, 2017 at 1:30 pm #801995Hi @Eric,
1- We would be glad to help you with this customization, but at the moment there is no easy way to do this by using a small custom code snippet, so I am afraid its out of the scope of our support.
But please feel free to request such feature at our feature request system: https://kriesi.at/support/enfold-feature-requests/
This system allows us to keep track of user suggestions and lets you vote on the feature you would like to see the most. I am afraid though there is no guarantee that a feature will get implemented. If that’s something you really need you can always try to hire a developer for the task :)
2- Please change the code to following one$output .= "<time class='av-magazine-time updated' {$markupTime}>".tribe_get_start_date( $entry->ID,false, $format = 'l, F j, Y @ g:i A' )."</time>";
You can find out more about date format here – https://codex.wordpress.org/Formatting_Date_and_Time
Best regards,
YigitJuly 6, 2017 at 4:08 am #817000Hi Yigit,
We were able to accomplish the two changes we needed but unfortunately came across feature creep with the magazine post element and the dates. We were able to update the magazine.php file in the child theme directory with the updated code snippet to show the start date of the Event Calendar plugin posts.The only problem is that this changes the date shown for all post used within the magazine post element. Any post that is not of the Event Calendar post type shows today’s date. I guess it’s looking for the Event Calendar start date–which doesn’t exist for normal wordpress posts.
So, the goal is to continue to use the magazine post element to showcase posts for the Event Calendar and normal wordpress posts but for the former pull start dates of the event and for the latter pull the default publish dates.
Is there a way to update the magazine.php file to accomplish this? Maybe some kind of boolean script that checks the post type and displays different dates based on post category?
Thanks!
EricJuly 10, 2017 at 11:28 am #818641Hi Eric,
You could try something like this:
if ( in_category('your category name') ) { $output .= "<time class='av-magazine-time updated' {$markupTime}>".tribe_get_start_date( $entry->ID,false, $format = 'l, F j, Y @ g:i A' )."</time>"; } else { $output .= "<time class='av-magazine-time updated' {$markupTime}>".$time."</time>"; }
If you need further assistance please let us know.
Best regards,
VictoriaJuly 14, 2017 at 2:43 am #820913Thanks Victoria! We’ll give this a shot and let you know how it goes.
July 14, 2017 at 10:11 am #821073Hi,
Thanks for the feedback. Please let us know how you get on with.
Best regards,
RikardJuly 28, 2017 at 9:00 am #830956We’re almost there! It appears that using categories doesn’t work as Event Calendar plugin uses its own post categories. What would the snippet look like if we looked for a tag instead of category? We’re noticing that both WordPress posts and Event Calendar posts share the same tags–just not categories. :(
What would we put in place of “in_category” to look up the tag of the post to apply the date to? Thanks!
July 31, 2017 at 1:57 pm #832123Hi Eric,
This function might help you
<?php if ( has_tag('abc')
If you need further assistance please let us know.
Best regards,
VictoriaAugust 1, 2017 at 11:02 pm #833119We ended up making the change specifically for the page where we needed the event calendar specific update. This way all other magazine elements used throughout the site would not be affected. Here’s the snippiet of code we placed inthe magazine.php file in the child theme:
if ( is_page( ‘enter post ID number here’ ) ) {
$output .= “<time class=’av-magazine-time updated’ {$markupTime}>”.tribe_get_start_date( $entry->ID,false, $format = ‘F j, Y’ ).”</time>”; /* DISPLAYS EVENT CALENDAR DATE */
} else {
$output .= “<time class=’av-magazine-time updated’ {$markupTime}>”.$time.”</time>”;
}August 2, 2017 at 12:59 pm #833406Hi,
Glad you figured it out and thanks for sharing your solution!
Best regards,
YigitFebruary 5, 2018 at 7:44 pm #908159Hey I had a same issue. I am not using the child theme I am afraid that my changes would be lost. I am using posts for event management but it is coming up with post creation date instead of event date. Also where on posts I can mention the event date ? In context or where ?How can I achieve this ?
February 6, 2018 at 7:53 pm #908748Hi,
Why not follow the solution provided by adding it into your child theme?
That should solve your issues easily.Best regards,
BasilisFebruary 6, 2018 at 7:56 pm #908750how to add child theme ? Adding this will affect the current changes ?
February 6, 2018 at 9:13 pm #908820Hi,
Please take a look at the documentation
and let us know if that covers you
Best regards,
BasilisNovember 7, 2018 at 12:55 am #1030664Hi Enfold Support,
We noticed that recent updates to Enfold have changed the way Events Calendar by Tribe isn’t showing the proper meta. Ideally we need event posts powered by Events Calendar to show start and end dates (Tribe event date meta) when using the magazine post element instead of post creation dates. The above hack to the functions.php file addressed this. Although the other meta data is showing up now with some issues i.e. the breadcrumbs (author and date separate “/”) now appear when they didn’t before and don’t have any spacing.We also noticed that the sorting by Tribe Event Calendar event dates (not post publish dates) isn’t working any longer. We have updated the theme adding the method above to add additional sort function to the magazine post element but the event posts aren’t sorting by the Event Calendar event dates but rather the publish dates.
Link and login info is provided below.
Thanks!
Eric -
AuthorPosts
- The topic ‘Events Date in Magazine element (not creation Date)’ is closed to new replies.