Assign "The Events Calendar" to Subpage

for a small project i need to assign the The Events Calendar Plugin to an subpage but i've found no solution in the documentation.

Does anyone know if this is possible or has an idea to get it done?

Regards

Topic plugin-events-calendar Wordpress

Category Web


Here's a basic page template for displaying an events calendar in grid form based on the grid template bundled with the plugin. Edit as necessary to match the styling and layout of your theme:

<?php

/**
 * Template Name: Event Gridview
 **/
global $spEvents;
$spEvents->loadDomainStylesScripts();
get_header();

query_posts('post_type=post&category_name=Events&posts_per_page=-1');
?>
    <div id="tec-content" class="grid">
        <div id='tec-events-calendar-header' class="clearfix">
            <h2 class="tec-cal-title"><?php _e('Calendar of Events', $spEvents->pluginDomain) ?></h2>
            <span class='tec-month-nav'>
                <span class='tec-prev-month'>
                    <a href='<?php echo events_get_previous_month_link(); ?>'>
                    &#x2190; <?php echo events_get_previous_month_text(); ?>
                    </a>
                </span>

                <?php get_jump_to_date_calendar( "tec-" ); ?>

                <span class='tec-next-month'>
                    <a href='<?php echo events_get_next_month_link(); ?>'>              
                    <?php echo events_get_next_month_text(); ?> &#x2192; 
                    </a>
                </span>
            </span>

            <span class='tec-calendar-buttons'> 
                <a class='tec-button-off' href='<?php echo events_get_listview_link(); ?>'><?php _e('Event List', $spEvents->pluginDomain)?></a>
                <a class='tec-button-on' href='<?php echo events_get_gridview_link(); ?>'><?php _e('Calendar', $spEvents->pluginDomain)?></a>
            </span>
        </div><!-- tec-events-calendar-header -->
        <?php
        global $wp_query;
        $tecCatObject = get_category( $wp_query->query_vars['cat'])
        ?>
        <a class="ical" href="<?php bloginfo('home'); ?>/?ical=<?php echo $tecCatObject->slug; ?>"><?php _e('iCal Import', $spEvents->pluginDomain) ?></a>
        <?php event_grid_view(); // See the plugins/the-events-calendar/views/table.php template for customization ?>   
    </div>
<?php /* For custom template builders...
       * The following init method should be called before any other loop happens.
       */

wp_reset_query();
$wp_query->init(); ?>
<?php get_footer(); ?>

The key component being the query_posts call after the header is called. You can use this to modify the other template files in the views subfolder of the plugin to adapt the other calendar views into additional page templates.

I have tested this using the free version of the plugin linked in Wordpress v3.2.1, no shortcodes necessary.


If you're trying to place it on a php template page you can use

<?php echo do_shortcode('[events-calendar-large]'); ?>

Also, they have quite a bit of information in "Other Notes" on their WordPress plugin page. http://wordpress.org/extend/plugins/the-events-calendar/other_notes/


Do you mean you want to display the calendar on a sub page? If so you can use this shortcode on the page where you want it to display:

[events-calendar-large] 

Let us know if this isn't what you meant. Best of luck!

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.