Home › Forums › Calendar Products › Events Calendar PRO › list-widget
- This topic has 13 replies, 2 voices, and was last updated 10 years ago by
Geoff.
-
AuthorPosts
-
April 5, 2016 at 1:44 pm #1098598
audrey
ParticipantThis is a follow-up question to a previous topic which is now closed.
Previous question:
I would like the View more link to go to a list instead of the calendar. Can this be done even though the default view of the Events (main page) is Calendar?Previous answer:
Thanks for reaching out to us!You can accomplish this by following our Themer’s Guide to copy the list widget file found within the core Events Calendar plugin at src > views > widgets > list-widget.php file and copying it into your theme and modifying that link within that file to link to “/events/list”.
Let me know if this helps.
Follow-up question:
Can you provide the specific code for “modifying that link within that file to link to “/events/list” ?April 6, 2016 at 2:17 pm #1099180Geoff
MemberHello Audrey,
Sure! It’s changing this:
<p class="tribe-events-widget-link"> <a href="<?php esc_attr_e( esc_url( $link_to_all ) ) ?>" rel="bookmark"> <?php esc_html_e( 'View More…', 'tribe-events-calendar-pro' ) ?> </a> </p>…to this:
<p class="tribe-events-widget-link"> <a href="/events/list" rel="bookmark"> <?php esc_html_e( 'View More…', 'tribe-events-calendar-pro' ) ?> </a> </p>Do note, however, that correct file to do that in is located in the Events Calendar PRO plugin, under src/views/widgets/list-widget. The original answer advised you to look in the core plugin.
Cheers!
GeoffApril 7, 2016 at 1:17 pm #1099825audrey
ParticipantGeoff,
I implemented this change but the ‘View More’ link still produces the calendar as the default, not a list. I did have to use a path slightly different from the one you mention. i.e.,
src/views/pro/widgets/list-widget.php
Any ideas??
April 7, 2016 at 3:30 pm #1099867Geoff
MemberHmm, that is very strange. It seems to work when I give it a try, so that’s perplexing.
What happens if you try making the change to the original file from the first reply you got? Does that make a difference?
Geoff
April 8, 2016 at 10:27 am #1100161audrey
ParticipantThe first reply suggested this –
“copy the list widget file found within the core Events Calendar plugin at src > views > widgets > list-widget.php file”Can you provide me with the complete path to this file? The path I am using to get to the Pro file is –
/wp-content/plugins/events-calendar-pro/src/views/pro/widgetsApril 8, 2016 at 1:10 pm #1100224Geoff
MemberSure! It’s located at:
wp-content/plugins/the-events-calendar/src/views/widgets/list-widget.php
April 8, 2016 at 1:46 pm #1100254audrey
ParticipantThe code is a little different in this list-widget.php file. I assume I will use the replacement code
as before. What code should I replace in this file? Probably
” rel=”bookmark”>
Is that correct?April 8, 2016 at 1:50 pm #1100256audrey
ParticipantGeoff,
I see on the Forum that parts of my message are missing. I’m not sure what happened. Since the code is a little different in this list-widget.php file I was asking about what edit to make.
April 11, 2016 at 7:47 am #1100759Geoff
MemberHi Audrey,
Yes, please try adding the code I provided to that file where you would like the View More link to appear and that should do the trick.
Thanks!
GeoffApril 11, 2016 at 8:44 am #1100808audrey
ParticipantHi Geoff
I made the edit and tried the new list-widget.php file. Still did not work.
Here is the edited file code snippet –<p class="tribe-events-widget-link"> <a href="/events/list" rel="bookmark"> <?php printf( esc_html__( 'View All %s', 'the-events-calendar' ), $events_label_plural ); ?></a> </p>April 12, 2016 at 7:54 am #1101301audrey
ParticipantHi Geoff,
I don’t think this is going to work for me. Any other suggestions before I give up on this?
April 12, 2016 at 8:00 am #1101307Geoff
MemberHey Audrey,
So sorry for the trouble with this!
I’ve been able to make the change on my test site, so let’s start back at the beginning so I can outline how I did it.
- Make a copy of the list-widget.php file. It’s located at /wp-content/plugins/events-pro/src/views/pro/widgets/list-widget.php
- Make a new folder in your theme directory called tribe-events
- Make a new folder in that one called pro
- Make a new folder in that one called widgets
- Drop the copied list-widget.php file into that last folder
- Replace the code in the copied list-widget.php with this code
- Save changes
Following these steps did the trick for me. Do they work for you too?
Thanks so much!
GeoffApril 12, 2016 at 9:25 am #1101390audrey
ParticipantGood news, it works!!
The steps you gave me are a little different from what I was doing. Not sure how I got off track.
Many thanks.
April 13, 2016 at 7:20 am #1101915Geoff
MemberAwesome! Nice work and so glad to hear that did the trick. I know customizations aren’t always easy, so high fives for getting it done. 🙂
I’ll go ahead and close this thread but do please feel free to reach back out if any other questions pop up and we’d be happy to help.
Cheers,
Geoff -
AuthorPosts
- The topic ‘list-widget’ is closed to new replies.
