Thursday, 19 July 2018

How to Add Next Previous links to The Event Calendar

Add Next/Previous links to The Event Calendar Wordpress Plugin

Add code to your child theme’s functions.php file

/**
 * Allows visitors to page forward/backwards in any direction within month view
*/

if ( class_exists( 'Tribe__Events__Main' ) ) {

class ContinualMonthViewPagination {
    public function __construct() {
        add_filter( 'tribe_events_the_next_month_link', array( $this, 'next_month' ) );
        add_filter( 'tribe_events_the_previous_month_link', array( $this, 'previous_month' ) );
    }

    public function next_month() {
        $url = tribe_get_next_month_link();
        $text = tribe_get_next_month_text();
        $date = Tribe__Events__Main::instance()->nextMonth( tribe_get_month_view_date() );
        return '<a data-month="' . $date . '" href="' . $url . '" rel="next">' . $text . ' <span>&raquo;</span></a>';
    }

    public function previous_month() {
        $url = tribe_get_previous_month_link();
        $text = tribe_get_previous_month_text();
        $date = Tribe__Events__Main::instance()->previousMonth( tribe_get_month_view_date() );
        return '<a data-month="' . $date . '" href="' . $url . '" rel="prev"><span>&laquo;</span> ' . $text . ' </a>';
    }
}

new ContinualMonthViewPagination;

}

20 comments:

  1. I simply wanted to write down a quick word to say thanks to you for those wonderful tips and hints you are showing on this site.Block Chain Training in chennai

    Block Chain Training in annanagar

    Block Chain Training in pune

    Block Chain Training in velachery

    ReplyDelete
  2. I simply wanted to write down a quick word to say thanks to you for those wonderful tips and hints you are showing on this site.Block Chain Training in chennai

    Block Chain Training in annanagar

    Block Chain Training in pune

    Block Chain Training in velachery

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.


    rpa training in chennai | best rpa training in chennai | rpa training in chennai | rpa training in bangalore
    rpa training in pune | rpa online training

    ReplyDelete
  6. I really enjoy simply reading all of your weblogs. Simply wanted to inform you that you have people like me who appreciate your work. Definitely a great post I would like to read this
    Data Science Training in Chennai | Data Science training in anna nagar
    Data Science training in chennai | Data science training in Bangalore
    Data Science training in marathahalli | Data Science training in btm

    ReplyDelete
  7. Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.
    java training in chennai

    java training in marathahalli | java training in btm layout

    ReplyDelete
  8. I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it.
    python training Course in chennai
    python training in Bangalore
    Python training institute in kalyan nagar

    ReplyDelete
  9. A very nice guide. I will definitely follow these tips. Thank you for sharing such detailed article. I am learning a lot from you.

    rpa training in electronic-city | rpa training in btm | rpa training in marathahalli | rpa training in pune

    ReplyDelete
  10. Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.
    Best Devops Training in pune

    ReplyDelete
  11. All are saying the same thing repeatedly, but in your blog I had a chance to get some useful and unique information, I love your writing style very much, I would like to suggest your blog in my dude circle, so keep on updates.
    Selenium Training in Chennai
    Best selenium training in chennai
    iOS Training in Chennai
    Digital Marketing Training in Chennai
    .Net coaching centre in chennai
    JAVA Training
    Best JAVA Training institute in Chennai
    Java Courses in Chennai

    ReplyDelete
  12. Thanks a lot for sharing us about this update. Hope you will not get tired on making posts as informative
    as this

    smart-writing
    Technology

    ReplyDelete
  13. I’m planning to start my blog soon, but I’m a little lost on everything. Would you suggest starting with a free platform like Word Press or go for a paid option? There are so many choices out there that I’m completely confused. Any suggestions? Thanks a lot.



    AWS Training in NewYork City | Amazon Web Services Training in Newyork City


    AWS Training in London | Amazon Web Services Training in London, UK

    Amazon Web Services Online Training in USA | AWS Online Course in USA

    ReplyDelete
  14. This comment has been removed by the author.

    ReplyDelete
  15. such an effective blog you are posted.this blog is full of innovative ideas and i really like your information's. i expect more ideas from your site please add more details in future.
    python training courses near me

    best python course in bangalore
    best python training bangalore
    python scripting classes in bangalore

    ReplyDelete