Do you want to add a Google Calendar in your WordPress site? Google Calendar is one of the most useful apps. It allows you to manage your schedule, share events, and organize everything around you. In this article, we will show you how to add a Google Calendar in WordPress.
您是否要在WordPress网站中添加Google日历? Google日历是最有用的应用程序之一。 它使您可以管理日程,共享事件并组织周围的一切。 在本文中,我们将向您展示如何在WordPress中添加Google日历。

To make it easy, we have created a video tutorial on how to install a WordPress plugin that you can watch below.
为简单起见,我们创建了一个视频教程,介绍如何安装WordPress插件,您可以在下面观看。
However if you just want to follow text-instructions, then you can follow our step by step tutorial on how to How to add Google Calendar in WordPress.
但是,如果您只想按照文本说明进行操作,则可以按照有关如何在WordPress中添加Google日历的逐步指南进行操作。
First thing you need to do is install and activate the Simple Calendar – Google Calendar Plugin. Upon activation, you need to visit Calendars » Settings page to configure the plugin.
您需要做的第一件事就是安装并激活“ 简单日历-Google日历插件” 。 激活后,您需要访问日历»设置页面以配置插件。

First you need to connect the plugin to your Google Calendar. This requires giving the plugin access to your calendar data. For that you need to create and provide a Google API Key.
首先,您需要将插件连接到Google日历。 这要求授予插件访问您的日历数据的权限。 为此,您需要创建并提供Google API密钥。
Simply visit Google Developer Console website and click on create new project button.
只需访问Google Developer Console网站,然后单击“创建新项目”按钮。

This will bring up a popup where you need to provide a name for your project. It could be anything you want, but we recommend using something that helps you identify the project.
这将弹出一个弹出窗口,您需要在其中为项目提供名称。 可能是您想要的任何东西,但我们建议您使用有助于您识别项目的东西。

You will now be redirected to your project dashboard where you need to click on the Enable and Manage API Keys link.
现在,您将被重定向到您的项目仪表板,您需要在其中单击“启用和管理API密钥”链接。

You will be brought to a page showing all the Google products and services. You need to click on the Google Calendar API located under Google Apps APIs section.
您将被带到显示所有Google产品和服务的页面。 您需要单击Google Apps API部分下的Google Calendar API。

On the next page, you will be asked to confirm that you want to enable the Calendar API. Simply click on the Enable button to continue,
在下一页上,系统将要求您确认要启用Calendar API。 只需单击“启用”按钮继续,

While your API is now enabled, you still need the details o how you would access the API and what credentials you will be using. Click on the go to credentials button to continue.
现在启用了API后,您仍然需要详细信息o如何访问API以及将使用的凭据。 单击转到凭据按钮以继续。

This will bring you to a page where you need to choose the credentials. We will be using the API key as the credential to connect Google Calendar to WordPress. Click on the API key link to proceed.
这将带您到需要选择凭据的页面。 我们将使用API密钥作为将Google日历连接到WordPress的凭据。 单击API密钥链接以继续。

You will be now ask to choose where you will be using the key. Since you will be using it on a web server, you need to click on Server key to continue.
现在将要求您选择要在哪里使用密钥。 由于将在Web服务器上使用它,因此需要单击Server键才能继续。

Finally, you need to provide a name for the key. This could be anything that you can later identify easily. You can leave the IP addresses field blank.
最后,您需要提供密钥的名称。 这可能是您以后可以轻松识别的任何内容。 您可以将IP地址字段留空。

You have successfully created an API key to use with your Google Calendar. Now you can copy the API key and paste it in the plugin’s settings page.
您已经成功创建了可与Google日历一起使用的API密钥。 现在,您可以复制API密钥并将其粘贴到插件的设置页面中。
Don’t forget to click on the save changes button to store your settings.
不要忘记单击“保存更改”按钮来存储您的设置。
公开您的Google日历 (Making Your Google Calendar Public)
If you want to share a Google Calendar, then you need to change calendar settings and make it public. Here is a step by step guide on how to make your Google Calendar public.
如果要共享Google日历,则需要更改日历设置并将其公开。 这是有关如何公开您的Google日历的逐步指南。
Simply go to Google Calendars and click on the drop down icon next to the calendar you want to share.
只需转到Google日历,然后单击要共享的日历旁边的下拉图标。

This will take you to calendar sharing settings. You need to check the box next to make your calendar public and then click on the save button.
这将带您进入日历共享设置。 您需要选中旁边的框以将日历公开,然后单击“保存”按钮。

The last thing you need is to get the unique calendar ID. You will need this ID to display the Calendar in WordPress. Simply click on the Calendar details tab.
您需要做的最后一件事是获取唯一的日历ID。 您将需要此ID才能在WordPress中显示日历。 只需单击“日历详细信息”选项卡。

Scroll down to the calendar address section page. There you will find your calendar ID. You need to copy this ID and paste it in a text file. You will need this calendar ID in the next step.
向下滚动到日历地址部分页面。 您可以在其中找到日历ID。 您需要复制此ID并将其粘贴到文本文件中。 下一步将需要此日历ID。

在WordPress中添加新日历 (Adding a New Calendar in WordPress)
You have successfully connected your WordPress site with your Google Calendars. The next step is to add Google Calendar in WordPress.
您已成功将WordPress网站与Google日历关联。 下一步是在WordPress中添加Google日历。
Simply go to Calendars » Add New page. You will see a screen much like the post or page editing screens in WordPress.
只需转到日历»添加新页面。 您将看到一个类似于WordPress中的帖子或页面编辑屏幕的屏幕。

Start by entering a title for your calendar. You will notice that the plugin has already added some shortcodes and text in the textarea. You can leave that as it is and scroll down to the calendar settings box below the text editor.
首先输入日历标题。 您会注意到该插件已经在textarea中添加了一些短代码和文本。 您可以保持原样,然后向下滚动到文本编辑器下方的日历设置框。
You need to click on the Google Calendar tab in the calendar settings box and paste your Calendar ID.
您需要点击日历设置框中的Google日历标签,然后粘贴您的日历ID。

You can also click on other tabs in the calendar settings box to customize how the calendar will display on your WordPress site.
您还可以单击日历设置框中的其他选项卡,以自定义日历在WordPress网站上的显示方式。
When you are done, simply click on the publish button to save your calendar.
完成后,只需单击“发布”按钮即可保存日历。
在WordPress网站上显示Google日历 (Display Google Calendar on Your WordPress Site)
The Google Calendar you just created is not visible on your WordPress site yet. You will still need to add the calendar to a WordPress post or page.
您刚刚创建的Google日历在WordPress网站上尚不可见。 您仍然需要将日历添加到WordPress帖子或页面。
Simply create or edit a WordPress post or page. On the post editor screen, you will notice the new ‘Add Calendar’ button.
只需创建或编辑WordPress帖子或页面即可。 在帖子编辑器屏幕上,您会注意到新的“添加日历”按钮。

This will bring up a popup where you can select the calendar you just added from a drop down menu.
这将弹出一个弹出窗口,您可以从下拉菜单中选择刚添加的日历。
You can also attach a calendar to a post by selecting it from the attach calendar metabox on the post edit screen.
您还可以通过在帖子编辑屏幕上的“附加日历” metabox中选择日历来附加日历。

If you want to display your Google calendar in a sidebar widget, then Simple Calendar plugin has a widget for that.
如果您想在侧边栏小部件中显示您的Google日历,则“简单日历”插件将提供一个小部件。
You will need to visit the Appearance » Widgets page and find the Simple Calendar widget in the list of available widgets. Next, simply drag and drop the widget to a sidebar.
您将需要访问外观»小部件页面,并在可用小部件列表中找到“简单日历”小部件。 接下来,只需将小部件拖放到侧边栏。
In widget settings, you will need to select your calendar from the drop down menu. Don’t forget to click on the save button to store your widget settings.
在窗口小部件设置中,您需要从下拉菜单中选择日历。 不要忘记单击“保存”按钮来存储您的小部件设置。

That’s all, you can now visit your website to see your Google Calendar in action. You will notice that the plugin will beautifully highlight your events on the calendar. If you take the mouse over to an event, it will display event details.
就是这样,您现在可以访问您的网站以查看您的Google日历。 您会注意到,该插件将在日历上突出显示您的活动。 如果将鼠标移到事件上,它将显示事件详细信息。

We hope this article helped you learn how to add Google Calendar in WordPress. You may also want to see our guide on how to install Google Analytics in WordPress.
我们希望本文能帮助您学习如何在WordPress中添加Google日历。 您可能还希望查看有关如何在WordPress中安装Google Analytics(分析)的指南。
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在Twitter和Facebook上找到我们。
翻译自: https://www.wpbeginner.com/plugins/how-to-add-google-calendar-in-wordpress/