[wordpress插件] British Foreign Office Travel Advice英国外交部旅行建议

wordpress 插件 文章 2020-03-11 17:10 463 0 全屏看文

AI助手支持GPT4.0

评分
20
描述

British Foreign Office data includes information on safety and security, terrorism, local laws and customs, entry requirements, health and other aspects of travel for countries across the globe.

英国外交部的数据包括有关安全和保安,恐怖主义,当地法律和习俗,入境要求,健康以及全球其他国家旅行方面的信息。

You can display the data in two ways:

您可以通过两种方式显示数据:

    • Via a button which pulls through the data via ajax

      通过按钮可通过ajax提取数据

    • Loads the data directly while loading the page

      在加载页面时直接加载数据

    Directions

    方向

    1) Install the plugin

    1)安装插件

    2) Create a custom meta tag called ‘geo_country’ to any post, adding the country you want information for.

    2)在任何帖子中创建一个名为“ geo_country”的自定义元标记,并添加您要获取信息的国家/地区。

    A full list of countries is available from the BFO website.

    可以从 BFO网站获得国家的完整列表。

    3) There are two shortcodes you can use:

    3)您可以使用两种简码:

    [fo-advice] – gets info as the page loads (displayed in an accordion type box)

    [fo-advice] –在页面加载时获取信息(在手风琴类型框中显示)

    [fo-advice-button] creates a button which when clicked, will retrieve and display the data via ajax.

    [fo-advice-button]创建一个按钮,单击该按钮将通过ajax检索并显示数据。

    Demos

    Demos

    Info loading as the page loads

    页面加载时信息加载

    Button and ajax loading

    按钮和ajax加载

    Suggestions

    建议

    Create a text widget with a title called ‘BFO Advice’

    创建一个标题为“ BFO Advice”的文本小部件。

    Drop the shortcode in the text area.

    将简码放在文本区域。

    or

    Drop the code below into your widgets area of your code.

    将下面的代码拖放到代码的小部件区域。

    It will only display a widget if the meta tag ‘geo_country’ is detected.

    仅在检测到元标记“ geo_country”时才会显示小部件。

      <?php

    /* look for a meta field called geo_country specific to the post displayed and if it's there, display a widget*/

    / *查找特定于所显示帖子的名为geo_country的元字段,如果存在,则显示小部件* /

    $themeta = get_post_meta($pageID);

    $ themeta = get_post_meta($ pageID);

    if (array_key_exists("geo_country",$themeta))

    如果(array_key_exists(“ geo_country”,$ themeta))

    {

    {

    utopia_get_foreign_office();

    utopia_get_foreign_office();

    };

    };

    function utopia_get_foreign_office(){

    函数utopia_get_foreign_office(){

    echo '

    ';

    回声'

    ';

    echo '

    Foreign Office Advice

    ';

    回显“

    国外办公室建议”;

    echo do_shortcode('');

    回声do_shortcode('');

    echo '

    ';

    回声'';

    };

    };

    ?>

    ?>

    The way the information is formatted into elements is near the bottom of index.php (line 207 onwards).

    将信息格式化为元素的方式位于index.php的底部附近(从第207行开始)。

    You can add a title by unremarking line 208. We’ve deliberately left the code with lots of space and relatively easy to understand so you can reformat how you see fit.

    您可以通过取消标记第208行来添加标题。我们故意在代码中留出了很大的空间,并且相对易于理解,因此您可以重新格式化自己的显示方式。

    Beware!

    当心!

    The elements and their classes / IDs are tied in to the accordion.

    元素及其类/ ID与手风琴绑定在一起。

    For the accordion reference and options see www.snyderplace.com

    有关手风琴的参考和选项,请参见 www.snyderplace.com

    Donate

    捐赠

    You can always donate as a way of saying thanks!

    您始终可以捐赠以表示感谢!

    Additional Info

    其他信息

    Thanks to www.snyderplace.com for the JQuery Accordion.

    感谢 www.snyderplace.com 使用JQuery手风琴。

安装步骤

    1. Upload plugin-name.php to the ‘/wp-content/plugins/’ directory
    2. plugin-name.php 上载到“ / wp-content / plugins /”目录

    3. Activate the plugin through the ‘Plugins’ menu in WordPress
    4. 通过WordPress中的“插件”菜单激活插件

    5. Create a custom meta tag in any post called ‘geo_country’.

    6. 在任何名为“ geo_country”的帖子中创建自定义元标记。

      Include the country as the meta tag value.

    7. 将国家/地区作为元标记值。

    8. Use the shortcode [fo-advice] or [fo-advice-button]
    9. 使用简码[fo-advice]或[fo-advice-button]

下载地址
https://downloads.wordpress.org/plugin/british-foreign-office-travel-advice.zip
-EOF-

AI助手支持GPT4.0