Thursday, January 2, 2014

How to add the events calendar to the wordpress homepage

It took me 3 hours and going through 100s of useless code and forum threads on wordpress and the tribes site. with most of them clueless on how to add it to the main page .

This is my easy hack  (i do not know how to code or add php ). so i came up with this simple solution
1) make a page on wordpress
2) add the page links to plugin
3) point the page to a customer url http://www.yoursite.com/events/month/
4)Goto settings -> reading and set your wp static page to the wordpress page you made


-------------xxx----------xxxx------
below is the complicated solutions from around the web
First you will have to add this code (from the link) to your functions.php file:
https://gist.github.com/neillmcshea/e02186aa700db743aa41
function.phpPHP

//copy from here.....
add_action('wp_enqueue_scripts', 'enqueue_month_view_scripts');
function enqueue_month_view_scripts() {
    if ( is_front_page() ) {
        Tribe_Template_Factory::asset_package('ajax-calendar');
Tribe_Template_Factory::asset_package('events-css');
    }
}
//....to here into your function.php file
?>
This will ensure all that the proper css and javascript have been enqueued in the theme header.

Next in either you index.php or home.php add this line:
< ?php tribe_show_month() ?>


f you have the theme home page set to Your Latest Posts you’ll need to add the code above to either your theme’s index.php file or home.php


I’m not aware of any shortcodes, but if you’re comfortable with php there’s a plugin called Global Content Blocks (http://wordpress.org/plugins/global-content-blocks/) that will allow you to use some of the ECP template tags to create your own ‘shortcodes’. This will effectively let you plug them into any regular page. I used this method to pull upcoming events, or for the mini calendar in the pro version.

No comments:

Post a Comment