Home › Forums › Calendar Products › Events Calendar PRO › Week View for Widget
- This topic has 4 replies, 2 voices, and was last updated 11 years, 8 months ago by
Brian.
-
AuthorPosts
-
September 11, 2014 at 12:08 pm #738396
zerocool
ParticipantAny idea how to go about setting this up? My client is requesting this (more or less demanding this).
So far, I’ve been trying to modify the Events Calendar widget .. I have removed the Month navigation, and the headings, now I want to be able to isolate only the current week. I want to be able to list 5-7 days in a row … I don’t mind if the list starts with “Sunday” and ends on “Saturday” like a normal calendar, or if the first day in the list is “today”
(sorry I don’t know if this is the right section to ask this)
September 11, 2014 at 3:18 pm #738731zerocool
Participanti think i got it, the file i modified is widgets/mini-calendar/grid.php. Can someone take a quick look to make sure this is going to do what I want, whicch is to only show the row for this week? Here’s the code:
<?php
/**
* Mini Calendar Widget Grid Template
* This file loads the mini calendar widget grid
*
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/widgets/mini-calendar/grid.php
*
* @package TribeEventsCalendar
*
*/
if ( !defined(‘ABSPATH’) ) { die(‘-1’); } ?><?php
$days_of_week = tribe_events_get_days_of_week(‘short’);
$week = 0;?>
<div class=”tribe-mini-calendar-grid-wrapper”>
<table class=”tribe-mini-calendar” <?php tribe_events_the_mini_calendar_header_attributes() ?>>
<?php do_action( ‘tribe_events_mini_cal_before_header’ ); ?>
<!–
<thead class=”tribe-mini-calendar-nav”>
<tr>
<td colspan=”7″>
<div>
<?php tribe_events_the_mini_calendar_prev_link() ?>
<span id=”tribe-mini-calendar-month”><?php tribe_events_the_mini_calendar_title() ?></span>
<?php tribe_events_the_mini_calendar_next_link() ?>
” alt=”loading…” />
</div>
</td>
</tr>
</thead>
–>
<?php do_action( ‘tribe_events_mini_cal_after_header’ ); ?>
<?php do_action( ‘tribe_events_mini_cal_before_the_grid’ ); ?>
<!–
<thead>
<tr>
<?php foreach($days_of_week as $day) : ?>
<th class=”tribe-mini-calendar-dayofweek”><?php echo $day ?></th>
<?php endforeach; ?></tr>
</thead>
–><tbody class=”hfeed vcalendar”>
<tr>
<?php while (tribe_events_have_month_days()) : tribe_events_the_month_day(); ?>
<!–<?php if ($week != tribe_events_get_current_week()) : $week++; ?>
</tr>
<tr>
<?php endif; ?>–><?php if (tribe_events_get_current_week() == 1) : ?>
<td class=”<?php tribe_events_the_month_day_classes() ?>”>
<?php tribe_get_template_part( ‘pro/widgets/mini-calendar/single-day’ ) ?>
</td>
<?php endif; ?>
<?php endwhile; ?>
</tr>
</tbody>
<?php do_action( ‘tribe_events_mini_cal_after_the_grid’ ); ?>
</table>
</div> <!– .tribe-mini-calendar-grid-wrapper –>September 12, 2014 at 5:57 am #739829Brian
MemberHello zerocool,
I can certainly take a look at the coding.
This is the correct place to post this and I do not want to set your expectations too high for this, we will help out as much as we can, answering question or giving you a tip or two, but I would just like you to be aware that ultimately the customization is up to you.
However, can you load the coding into a site like Pastebin or as a Gist and then include the link here.
Coding does not come across very well in the forum so as I currently copy it there are not many character adjustments to make to get it to work.
So please send me a link for the coding and I will take a look at let you know what I find out.
Thanks
September 14, 2014 at 11:33 am #743799zerocool
ParticipantThis reply is private.
September 15, 2014 at 6:35 am #744591Brian
MemberHi zerocool,
Sounds good about the changes and making this a personal project. I also think it is a good idea so I hope you succeed in it.
You can share by creating a new topic here with a link and on the WordPress.org Plugin Page in the support section.
I am going to close this ticket as you marked is resolved, but if you have questions in the future on your week view widget or anything else, please create a new ticket and we will help you out.
Thanks
-
AuthorPosts
- The topic ‘Week View for Widget’ is closed to new replies.
