Forum Replies Created
-
AuthorPosts
-
March 17, 2017 at 6:15 am in reply to: How would I wrap List View events after month separator in a div? #1255752
Tristan
ParticipantHi AndrĂ¡s,
Thank you very much, that’s very helpful.
Tristan
March 15, 2017 at 3:48 am in reply to: How would I wrap List View events after month separator in a div? #1254329Tristan
ParticipantHi Adras,
What I’m trying to achieve is the following, so that there’s a div wrapping all events after each month/year header:
<div class=”tribe-events-loop”>
<!– Month/Year Headers –>
<span class=”tribe-events-list-separator-month”><span>March 2017</span></span><div class=”my-wrapper-div”>
<!– Event –>
<div id=”post-763″ class=”type-tribe_events post-763 tribe-clearfix tribe-events-first”>// everything inside the event div
</div>
<!– Event –>
<div id=”post-764″ class=”type-tribe_events post-764 tribe-clearfix tribe-events-first”>// everything inside the event div
</div>
<!– Event –>
<div id=”post-765″ class=”type-tribe_events post-765 tribe-clearfix tribe-events-first”>// everything inside the event div
</div>
</div><!– end my wrapper div –>
<!– Month / Year Headers –>
<span class=”tribe-events-list-separator-month”><span>April 2017</span></span><div class=”my-wrapper-div”>
<!– Event –>
<div id=”post-766″ class=”type-tribe_events post-766 tribe-clearfix tribe-events-first”>// everything inside the event div
</div>
</div><!– end my wrapper div –>
</div>
March 14, 2017 at 11:00 am in reply to: How would I wrap List View events after month separator in a div? #1253991Tristan
ParticipantHi Adras,
Thanks for that!
The code in question is located in wp-content\plugins\the-events-calendar\src\views\list\loop.php. It’s not as simple as wrapping any code there in a div, as the function tribe_events_list_the_date_headers() only inserts the month span if the date has changed, and the documentation on that function is pretty sparse.
For now I’m just going to copy that template file to my theme and comment out the function which outputs the month headers, but it would be great if someone at Modern Tribe could figure this out.
Thanks,
Tristan
Tristan
ParticipantThank you so much, I’ve managed it!
Here’s the code that worked:
// rename various WooCommerce fields
function woocommerce_rename_fields( $translated_text, $text, $text_domain ) {
// bail if not modifying frontend woocommerce text
if ( is_admin() || ‘woocommerce’ !== $text_domain ) {
return $translated_text;
}
if ( ‘Apply Coupon’ === $text ) {
$translated_text = ‘Apply Code’;
}
if ( ‘Coupon:’ === $text ) {
$translated_text = ‘Gift Token or Voucher Code:’;
}
if ( ‘Proceed to PayPal’ === $text ) {
$translated_text = ‘Pay by card or PayPal’;
}
return $translated_text;
}
add_filter( ‘gettext’, ‘woocommerce_rename_fields’, 10, 3 );Tristan
ParticipantHi Cliff,
Thanks very much for that, that’s very helpful. It was just a code snippet I found on Stack Overflow, but I’ve changed the part in your second suggestion and I’m not sure where to start with your first suggestion; if you have any advice on documentation I could look at then that would be very much appreciated! I’ve tried to have that function run only on the checkout page (so that it doesn’t affect the class of the Google map) but to no avail.
Thanks again,
Tristan
Tristan
ParticipantOn my local copy of the site I have fixed all of the console errors, and have figured out that the following code in my functions.php is causing extra text to be added to the Google Map div’s class, which is causing it to stop working. The Google Map div’s class is now “tribe-events-gmap-Pay by card or PayPal”. When I comment out this function the map appears.
// change ‘proceed to PayPal’ text on checkout button
add_filter( ‘gettext’, ‘custom_paypal_button_text’, 20, 3 );
function custom_paypal_button_text( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case ‘Proceed to PayPal’ :
$translated_text = __( ‘Pay by card or PayPal’, ‘woocommerce’ );
break;
}
return $translated_text;
}I still need this in my functions.php though, as the client needs the PayPal button text changed and this shouldn’t be affecting the Tribe Events map. I will upload my local copy of the site now so that you can see.
Thanks for your help with this!
Tristan
ParticipantHi Cliff,
Thanks very much for that. Attached are the three admin screens. I’ve also tried deactivating other plugins as well as commenting out the enqueuing of other JS files on the site.
Thanks for your help!
Tristan
-
AuthorPosts
