[wordpress插件] Context Manager上下文管理器

wordpress 插件 文章 2020-04-01 15:10 380 0 全屏看文

AI助手支持GPT4.0

评分
100
描述

Context Manager makes your site behave differently depending on the current user’s context.

上下文管理器使您的网站的行为取决于当前用户的上下文。

Using the simple point-and-click admin pages, there are four different ways your site can react:

使用简单的点击式管理页面,您的站点可以有四种不同的反应方式:

    1. Include and exclude CSS and JavaScript files
    2. 包含和排除CSS和JavaScript文件

    3. Changing the behaviour of menu items
    4. 更改菜单项的行为

    5. Hiding widgets in sidebars
    6. 隐藏侧边栏中的小部件

    7. Adding extra classes to the tag.
    8. 标记添加额外的类。

    The plugin supersedes Menu Rules

    该插件取代菜单规则

    Example usage

    示例用法

    A website has e-commerce shopping functionality driven by a custom post type called ‘products’.

    网站具有由称为“产品”的自定义帖子类型驱动的电子商务购物功能。

    There’s an archive page called ‘shop’ that lists products and is linked to in the main navigation menu.

    在主导航菜单中有一个名为“商店”的存档页面,其中列出了产品并链接到该页面。

    A user visits ‘shop’ and the menu item becomes ‘active’, but when they click through to an individual product, the menu item loses its state.

    用户访问“商店”,菜单项变为“活动”,但是当他们单击进入单个产品时,菜单项将失去其状态。

    The user becomes lost.

    用户迷路了。

      1. Install the Context Manager plugin
      2. 安装 Context Manager插件

      3. Add a new context rule
      4. 添加新的上下文规则

      5. Give it a meaningful name in the title field.

      6. 在标题字段中为其赋予有意义的名称。

        This is just for administration purposes

      7. 这只是出于管理目的

      8. In the conditions field enter is_singular( 'product' )
      9. 条件字段中输入 is_singular('product')

      10. Choose Emulate current page as a child but do not create a menu item. as the menu rule
      11. 选择将当前页面模拟为子页面,但不创建菜单项。作为菜单规则

      12. Find your products page in the menu dropdown
      13. 在菜单下拉菜单中找到您的产品页面

      On the product page, there are irrelevant widgets that distract the user from making a purchase.

      在产品页面上,有不相关的小部件使用户无法进行购买。

        • Hide irrelevant widgets under the widgets reaction
        • widgets 反应下隐藏不相关的小部件

        The whole shop section requires its own colour scheme, but there’s no common class that ties all the pages together.

        整个商店部分需要使用自己的配色方案,但是没有通用的类将所有页面捆绑在一起。

          • Enter shop-section class name in the body class reaction.

          • body class 反应中输入 shop-section 类名。

            Or alternatively, register another stylesheet using wp_register_style() in you theme's <

            或者,使用主题的 wp_register_style() 注册另一个样式表。

            code>functions.php.

          • code> functions.php

          • Create
          • 创建

          Remember to click publish when you’re ready to save.

          在准备好保存时,请记住单击发布。

          Have a look at screenshots to see the above setup in action.

          请查看屏幕截图,以查看上述设置。

          Support

          支持

          If you’re stuck, ask me for help on Twitter.

          如果您遇到困难,请在 Twitter 上寻求帮助。

安装步骤

    1. Download and unzip the folder from the WordPress plugins repository
    2. WordPress插件存储库中下载并解压缩文件夹

    3. Upload the context-manager folder into to the /wp-content/plugins/ directory
    4. 将context-manager文件夹上传到 / wp-content / plugins / 目录

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

    7. Open the ‘Appearance’ menu item and click the ‘Context Rules’ link
    8. 打开“外观”菜单项,然后单击“上下文规则”链接

下载地址
https://downloads.wordpress.org/plugin/context-manager.1.2.0.zip
-EOF-

AI助手支持GPT4.0