Instructions for creating events on WordPress with two simple ways – Learn WordPress from a to z

Tutorials 0 lượt xem

There’s no doubt that networking events can help any business grow. As a business owner, there is no better way to establish new relationships, be it with potential customers, business partners or investors.

There are different types of events and purposes; from simple meetings to large business meetings and conferences.

If you are struggling with the idea of ​​integrating events in your marketing plan but don’t know how to add it to your website, then you have come to the right place.

I will show you how to add WordPress events manually with code.

create event on wordpress with code

How to add events in WordPress with code

WordPress has a lot of benefits that make it more than just a simple blogging platform.

One of its most useful features is the ability to create custom content and display it exactly the way you want it to.

To display events on my website, I will take advantage of the functionality of WordPress and use custom post types.

How to add code

To get started, you will need to login to your WordPress dashboard and click on Appearance , then click on Editor .

After the editor loads, on the right side of the screen you will see a bunch of files.

The code for the custom post type needs to go to functions.php , so click on it to load it into the editor.

Now at the end of the functions.php file , paste the following code:

// register custom post type to work with
function lc_create_post_type() {
    // set up labels
    $labels = array (
        'name'               => 'Events',
        'singular_name'      => 'Event',
        'add_new'            => 'Add New Event',
        'add_new_item'       => 'Add New Event',
        'edit_item'          => 'Edit Event',
        'new_item'           => 'New Event',
        'all_items'          => 'All Events',
        'view_item'          => 'View Event',
        'search_items'       => 'Search Events',
        'not_found'          => 'No Events Found',
        'not_found_in_trash' => 'No Events found in Trash',
        'parent_item_colon'  => '',
        'menu_name'          => 'Events',
    );
    //register post type
    register_post_type ( 'event',
        array(
            'labels'              => $labels,
            'has_archive'         => true,
            'public'              => true,
            'supports'            => array( 'title', 'editor', 'excerpt', 'custom-fields', 'thumbnail','page-attributes' ),
            'exclude_from_search' => false,
            'capability_type'     => 'post',
            'rewrite'             => array( 
                'slug' => 'events' 
            ),
        )
    );
}
add_action( 'init', 'lc_create_post_type' );
<div>
<span>1</span><span>2</span><span>3</span><span>4</span><span>5</span><span>6</span><span>7</span><span>8</span><span>9</span><span>10</span><span>11</span><span>12</span><span>13</span><span>14</span><span>15</span><span>16</span><span>17</span><span>18</span><span>19</span><span>20</span><span>21</span><span>22</span><span>23</span><span>24</span><span>25</span><span>26</span><span>27</span><span>28</span><span>29</span><span>30</span><span>31</span><span>32</span><span>33</span><span>34</span>
</div>

The above code first creates a custom post type called event and tells WordPress what label you want to use with it. Then you need to register the post type and set it to act as a post. You also need to add standard classifications of categories and tags to make it easier to categorize your events later.

After you’ve added the code, click Save File. Now you will notice there is a new menu item in the sidebar called Events.

How to set up events on WordPress

You can start adding events to your website now. After a few events, navigate back to your dashboard and click Settings > Permalinks and click Save Changes to refresh the permalink. That allows your custom post type to show up on the front end. 

event on wordpress

If you want to add events to your navigation menu, go to Appearence > Menus and you will see that Events are displayed on the left. Simply drag any event to your menu to include them.

How to Add Events in WordPress Using a Plugin

1. The Events Calendar

the events calendar plugin

The Events Calendar is a user-friendly plugin. It is designed to be efficient and easy to use: just install, activate, configure the options to your liking. The plugin is fully responsive and works with all theme frameworks like Avada, Genesis, WooThemes and Thesis.

On top of that, the plugin is also SEO optimized and includes microformat support as well as translation and internationalization support.

The compact version of the plugin available on the repository comes with the following features:

  • Create events quickly
  • Save venue and organizer
  • Monthly calendar view with captions
  • List view
  • Day View
  • Event search
  • Google maps
  • Widget: Create next event list
  • Event Profitability (Category & tags)
  • Google Calendar and iCal export

The pro version ($89/year) of the plugin allows you to add recurring events, additional views and widgets, the ability to sell tickets, and manage attendees from within your WordPress dashboard.

What’s more, it integrates with popular e-commerce plugins like WooCommerce and Easy Digital Downloads as well as the ability to connect your Eventbrite account.

2. All in One Event Calendar

All In One Event Calendar plugin

All In One Event Calendar is a great plugin to create events on WordPress and easily share them with the world. Their calendar system combines a clean intuitive design and useful features. This plugin also has free and premium versions.

The free version of the plugin is available from the official repository and allows you to create and import unlimited events. Events can be displayed in Day, Week, Month, Agenda view, and the free version also allows you to create recurring events.

The pro version is available as a hosted solution that can be embedded into any web page and comes with additional features like CSV import, super utilities, ability to import future events, import RSS feeds and event submission UI. Paid plans start at $9/month.

3. WP Event Manager

plugin wp event manager wordpress

WP Event Manager is one of the simple, lightweight WordPress event management plugins. It is suitable for those who want to keep their website fast and not take up too much space or clutter the backend with cumbersome features. It quickly became a very popular plugin with great reviews and even better customer support. I’ve even noticed that users rave about the developer’s support for the free plugin version.

As with many of the plugins on this list, the WP Event Manager plugin offers a free, core plugin, along with the option to purchase premium add-ons to extend its functionality. Despite the beautiful and simple interface, the free plugin’s feature list is quite impressive.

The developers of WP Event Manager have put a lot of effort into speed and user experience – with nice caching features, responsive elements, AJAX powered event lists, etc. Some highlights with premium add-ons:

  • Calendar
  • Google Maps
  • Selling tickets WooCommerce
  • Register
  • Event announcement
  • Widgets for embedded events
  • Contact the organizer
  • Emails
  • Scroll bar
  • Google Analytics
  • Event tags

4. Events Manager

events manager plugin

Events Manager is a full-featured WordPress event management plugin that includes recurring events, location management, calendar, Google map integration, booking management, etc. Some features include:

  • Easy event registration (one day with start/end time)
  • Sign up for recurring and extended events (multiple days)
  • Manage bookings (including approval/rejection, export CVS and more!)
  • Multiple tickets
  • Multisite support
  • BuddyPress Support
  • Submit guest/member events
  • Specify event locations and view events by location
  • Google Maps

The premium version of the plugin, Events Manager Pro adds automated email reminders, coupon management, customizable booking forms, and integration with PayPal, Authorize.net, and offline payments. The Pro version of Events Manager is available for $75 for 1 site.

5. Event Organizer

Event Organizer plugin

Event Organizer adds event management using ‘custom post types’ in the content and allows you to create WordPress events with the same functionality as posts while adding additional features that allow you to Manage your events.

You can create complex scheduled recurring events and assign your events to locations. The user interface is intuitive and easy to use and events can be viewed as a WordPress list or on the calendar page.

The plugin can be further extended with extensions including end-user submission, discount codes, additional payment gateways, and iCal sync.

Event Organizer Pro has premium extras that will help you a lot. Prices start at $40 for an individual license.

Epilogue

This way you will be able to add and display simple events on your website.

If you find it interesting, you can follow the  WordPress basics section  to know more new knowledge.

Follow fanpage to receive the latest posts:  Group

Bài viết liên quan