Home › Forums › Calendar Products › Events Calendar PRO › Showing day and month outside of list-widget
- This topic has 10 replies, 2 voices, and was last updated 10 years, 12 months ago by
Brian.
-
AuthorPosts
-
March 9, 2015 at 3:00 am #946834
ite
ParticipantHi,
I want to show the daynumber and month of an event in two separated string.
I have found a code in the file list-widget.php, but when using this string it either shows “1” & “Jan” og todays date.How may I pull this string wherever inside a loop?
March 9, 2015 at 6:25 am #946883Brian
MemberHi,
Thanks for using our plugins. I can help get you in the right direction on this.
Can you provide a link to a pastebin(it is free and do not need an account) or gist of the coding you are using for this.
I can help make recommendations based on that.
Thanks
March 9, 2015 at 7:03 am #946887ite
ParticipantHi,
this is how I try to show the dayname:
http://pastebin.com/QzNjcCmGAnd here is the code I have in the page sidebar. I show the activity using Advanced Custom Fields on employees profile-pages:
http://pastebin.com/68ua84anHope this helps 🙂
March 9, 2015 at 4:01 pm #947099Brian
MemberOk thanks for that.
Have you included this above that coding:
$startDate = strtotime( $post->EventStartDate );
$endDate = strtotime( $post->EventEndDate );
$today = time();/* If the event starts way in the past or ends way in the future, let's show today's date */
if ( $today > $startDate && $today < $endDate ) {
$postDate = $today;
} else {
$postDate = $startDate;
}If you add that does it work then?
Let me know.
Thanks
March 10, 2015 at 4:06 am #947170ite
ParticipantHi, this code still shows todays date.
I have also edited the file single-event.php and added this in /MyThemefolder/tribe-events/
This shows correct date and you may see the code here: http://pastebin.com/GKw75FksDoes this help any further?
March 10, 2015 at 5:40 am #947182Brian
MemberI reduced the coding down to this and got it to work:
$startDate = strtotime( $post->EventStartDate );
$endDate = strtotime( $post->EventEndDate );
$today = time();
/* If the event starts way in the past or ends way in the future, let's show today's date */
if ( $today > $startDate && $today < $endDate )
$postDate = $today; else
$postDate = $startDate;?>
<div class="icon-date">
<h3><?php echo date_i18n( 'M', $postDate ) ?></h3>
<h4><?php echo date_i18n( 'd', $postDate ) ?></h4>
</div>You have to remove the filter for it to display.
Also you will have to grab the css or use your own to style how you would like.
That should get you started on your customization so you can take it from here.
Thanks
March 10, 2015 at 5:50 am #947185ite
ParticipantThis reply is private.
March 10, 2015 at 5:59 am #947192Brian
MemberThe Event List Widget is showing today’s date?
If so looks like a theme conflict, can you please follow our testing for conflicts guide:
And see if that resolves the issue.
Thanks
March 10, 2015 at 6:08 am #947198ite
ParticipantHi, as you may see in the code from the last post from me (http://pastebin.com/3wspsW26) the code that shows the event (and the wront date) is coded in the sidebar. It do not use the Event List Widget and trying a different theme would not work as the code is in the template files 🙂
March 10, 2015 at 11:41 am #947339Brian
MemberUnfortunately, I am unable to troubleshoot custom coding as it is beyond the support we can provide. If it was the Event List Widget I can help out otherwise for customizations we can point you in the right direction and you are going to have to take it from here.
April 30, 2015 at 5:00 am #959538Brian
MemberSince there is has not been any activity on this thread for over 2 weeks so I am now closing it. Feel free to start a new thread if you have further issues. Thanks! 🙂
-
AuthorPosts
- The topic ‘Showing day and month outside of list-widget’ is closed to new replies.
