-
AuthorPosts
-
March 4, 2015 at 4:03 am #405541
I thought I might be able to use the magazine content element in conjunction with Events Manager (EM) since it displays Categories separately. However, it apparently only understands posts/events in the order of when they are posted and not event dates that are set up within EM. For instance, what’s showing in each magazine module, defined by a single category, are events displayed by the date I added the event and not the actual date of the event (as defined in EM). Is there a workaround for this?
I am using the current versions of everything – WP, Enfold, Events Manager
March 4, 2015 at 7:39 pm #406008Hey Blaise!
Try opening up /enfold/config-templatebuilder/avia-shortcodes/magazine.php and find line 549.
$markupTime = avia_markup_helper(array('context' => 'entry_time','echo'=>false, 'id'=>$entry->ID, 'custom_markup'=>$this->atts['custom_markup']));
And change it to this.
if ( get_post_type() === TribeEvents::POSTTYPE ) { $markupTime = tribe_get_start_date(); } else { $markupTime = avia_markup_helper(array('context' => 'entry_time','echo'=>false, 'id'=>$entry->ID, 'custom_markup'=>$this->atts['custom_markup'])); }
Best regards,
ElliottMarch 5, 2015 at 2:14 am #406176Thanks. But when I did that, I get a blank page with this warning:
Parse error: syntax error, unexpected ‘}’ in /home/fakce/public_html/wordpress/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/magazine.php on line 553Line 553 is where your code fix ends if I replace your fix directly into line 549. I tried removing ‘}’ but got a different error. Should I have removed line 549 and placed your fix elsewhere – outside of the brackets that resides in?
March 5, 2015 at 7:30 pm #406627Hi!
Lines 547 – 555 should look like this.
$markupTitle = avia_markup_helper(array('context' => 'entry_title','echo'=>false, 'id'=>$entry->ID, 'custom_markup'=>$this->atts['custom_markup'])); $markupContent = avia_markup_helper(array('context' => 'entry_content','echo'=>false, 'id'=>$entry->ID, 'custom_markup'=>$this->atts['custom_markup'])); if ( get_post_type() === TribeEvents::POSTTYPE ) { $markupTime = tribe_get_start_date(); } else { $markupTime = avia_markup_helper(array('context' => 'entry_time','echo'=>false, 'id'=>$entry->ID, 'custom_markup'=>$this->atts['custom_markup'])); } $format = get_post_format($entry->ID) ? get_post_format($entry->ID) : 'standard'; $type = get_post_type($entry->ID);
Best regards,
ElliottMarch 5, 2015 at 9:33 pm #406686I made the change but it’s not doing anything – or the right thing.
Also, wouldn’t a change like this could be wiped out by an Enfold upgrade?March 6, 2015 at 6:07 pm #407159Hey!
Sorry, that was working fine for another customization I was doing in the loop but I didn’t check it here with the custom query. Instead try reverting all of the previous changes and then change line 532 from this.
$time = get_the_time(get_option('date_format'), $entry->ID);
To this.
if ( $entry->post_type == 'tribe_events' ) { $time = tribe_get_start_date($entry->ID, false, 'M j Y'); } else { $time = get_the_time(get_option('date_format'), $entry->ID); }
Regards,
Elliott- This reply was modified 9 years, 8 months ago by Elliott.
April 1, 2015 at 2:08 pm #421884Hello
We would like to do the same, combine Magazine and Event Manager.
My conclusion from what is written above is that I should only change line 532. Is that correct?
This doesn’t work in our case.
Do you have another solution for us?
Thanx,
Joke
(MediateamWingerd)April 2, 2015 at 6:38 am #422280Hi!
In what way does it not work? Are you getting any error messages, blank screen etc?
Best regards,
RikardApril 2, 2015 at 9:27 am #422353When we only change line 532 nothing happens.
When we change all the lines written above, the whole screen below the menu buttons turns black.April 2, 2015 at 8:19 pm #422747Hey!
You should only do this one, https://kriesi.at/support/topic/magazine-and-events-manager/#post-407159.
Deactivate all plugins and send us a link to your page and we’ll take a look.
Regards,
ElliottApril 3, 2015 at 3:47 am #422864Since I started this, I should note that the fixes Elliott gave us never worked. My code expert said at the time, “Elliotr is sending you fixes for the wrong calendar module. This tribe prefixed stuff is probably for https://theeventscalendar.com/product/wordpress-events-calendar/ . Also, he’s just changing the date display, and not anything to do with the ordering of the list – it’s probably fetching events by post date. I can’t imagine this working correctly if the code was correct for our module, even if it sorts in PHP by the event date. Also the issue about modifying the plugin files directly.”
So we ended up grabbing the magazine module code and added the Events Manager shortcodes to get it to do what we needed.
April 3, 2015 at 8:31 am #422917Hey!
Not sure if I understand you correctly, did you get your issue fixed?
Cheers!
RikardApril 3, 2015 at 5:57 pm #423196Basically, I had to abandon the module as it normally exists and recreate it using Events Manager shortcodes (all caps below) like this:
<div id=”av-magazine-1″ class=”av-magazine av-magazine-hero-left av-magazine-top-bar-active av-magazine-tabs-active”>
<div class=”av-magazine-top-bar”>
</div>
<div class=”av-magazine-group sort_all”>
<div class=”av-magazine-hero first flex_column av_one_half”>
[events_list offset=0 limit=1 scope=”future” category=”workshops”]
<article class=”hentry av-magazine-entry av-magazine-format-standard av-magazine-type-event av-magazine-entry-big”>
<div class=”av-magazine-thumbnail”>
#_EVENTIMAGE
</div>
<div class=”av-magazine-content-wrap”>
<header class=”entry-content-header”>
<time class=”av-magazine-time updated”>#_EVENTDATES</time>
<h3 class=”av-magazine-title entry-title” itemprop=”headline”>#_EVENTNAME</h3>
</header>
<div class=”av-magazine-content entry-content” itemprop=”text”>#_EVENTEXCERPT{10,…}</div>
</div>
<footer class=”entry-footer”></footer>
</article>
[/events_list]
</div>
<div class=”av-magazine-sideshow flex_column av_one_half”>
[events_list offset=1 limit=4 scope=”future” category=”workshops”]
<article class=”hentry av-magazine-entry av-magazine-format-standard av-magazine-type-event av-magazine-entry-small”>
<div class=”av-magazine-thumbnail”>
#_EVENTIMAGE{80,80}
</div>
<div class=”av-magazine-content-wrap”>
<header class=”entry-content-header”>
<time class=”av-magazine-time updated”>#_EVENTDATES</time>
<h3 class=”av-magazine-title entry-title” itemprop=”headline”>#_EVENTNAME</h3>
</header>
</div>
<footer class=”entry-footer”></footer>
</article>
[/events_list]
</div>
</div>
</div>
<hr>
<h3>All Workshops</h3>
<div class=’css-events-list’>
[events_list_grouped mode=”monthly” scope=”future” category=”workshops” limit=”10″ pagination=”1″ /]
</div>So that works as long as categories are assigned – and I had several. So using/tweaking the code without the WYSIWYG interface ultimately solved my problem. I put this here to help anyone else in this situation.
April 4, 2015 at 6:40 am #423365April 16, 2015 at 11:28 am #429512Thanks, but we stopped this option.
-
AuthorPosts
- The topic ‘Magazine and Events Manager’ is closed to new replies.