[wordpress插件] Byte's PHP Code Widget字节的PHP代码小部件

wordpress 插件 文章 2020-03-15 01:40 456 0 全屏看文

AI助手支持GPT4.0

评分
100
描述

This is a widget plugin that allow’s you to mix PHP and html code with mobile

这是一个小部件插件,可让您将PHP和html代码与移动设备混合使用

support.

支持。

Two text area’s are provided.

提供了两个文本区域。

The first is the standard “Title”.

第一个是标准的“标题”。

The one named “Code:” can mix PHP and html.

名为“代码:”的代码可以将PHP和html混合使用。

Two checkboxes allow you to choose

两个复选框可让您选择

before and/or after posts.

发布之前和/或之后。

No limit on the number of widgets.

小部件数量没有限制。

WordPress version 3.4 and higher has defined a function called wp_is_mobile().

WordPress 3.4及更高版本定义了一个名为wp_is_mobile()的函数。

This can be used inside your code mix to perform certain actions if the

如果

browser is mobile.

浏览器是移动的。

Mobile support is via wp_is_mobile() function which returns

通过wp_is_mobile()函数提供移动支持,该函数返回

true if on a mobile browser.

如果在移动浏览器上,则为true。

See the WordPress API for more information.

有关更多信息,请参见WordPress API。

Dynamic title support means that you can name your widget using the title

动态标题支持意味着您可以使用标题命名小部件

field and not have it displayed in the output.

字段,而不在输出中显示它。

This is useful to give

这对于给
很有用

your widgets meaningful names so you don’t lose track of what is going

您的小部件的有意义的名称,这样您就不会迷路了

on with your widgets.

在您的小部件上。

Two variables have been defined for use with Google Mobile Adsense:

已定义了两个变量供Google Mobile Adsense使用:

$myMobileAdsenseCode;

$ myMobileAdsenseCode;

$myMobileAdsenseSlot;

$ myMobileAdsenseSlot;

This widget requires some knowledge of PHP and HTML coding.

此小部件需要有关PHP和HTML编码的一些知识。

Misuse could crash

滥用可能导致崩溃

your site or cause errors with Adsense.

您的网站或导致Adsense错误。

Examples:

示例:

Output:

输出:

5

5

To use Google mobile adsense include the following in the “Code:” area:

要使用Google移动Adsense,请在“代码:”区域中添加以下内容:

The plugin will take care of the rest.

该插件将处理其余的工作。

Another check is made to ensure

再次检查以确保

that wp_is_mobile is true inside the plugin and that the Google Adsense variable

wp_is_mobile在插件中为true,并且Google Adsense变量为

has a value.

有一个值。

You can combine both regular and mobile adsense.

您可以将常规和移动adsense结合使用。

Be careful.

小心点。

The following snippet will either show mobile or regular ads depending on the

以下代码段将显示移动广告或常规广告,具体取决于

browswer used by the end-user.

最终用户使用的浏览器。

< ?php

<?php

if ( !wp_is_mobile() ) {

if(!wp_is_mobile()){

echo '

回声'

<!-后内容->

(adsbygoogle = window.adsbygoogle || []).push({});

(adsbygoogle = window.adsbygoogle || [])。push({});

‘;}

‘;}

else {

其他{

$myMobileAdsenseClient=’ca-mb-pub-xxxxxxxxxxxx’;

$ myMobileAdsenseClient ='ca-mb-pub-xxxxxxxxxxxx';

$myMobileAdsenseSlot=’xxxxxxxxxx’;

$ myMobileAdsenseSlot ='xxxxxxxxxx';

}?>

}?>

Ordered list:

订购清单:

    1. Support for the mixing of PHP and HTML
    2. 支持混合使用PHP和HTML

    3. Support for mobile browsers
    4. 对移动浏览器的支持

    5. Support for Google Adsense including mobilie
    6. 对Google Adsense的支持,包括移动电话

    7. Includes “before post” support
    8. 包括“发布前”支持

    9. Includes “after post” support
    10. 包括“发布后”支持

    11. No limit on the number of widgets
    12. 小部件数量无限制

    13. Includes dynamic title support in sidebars
    14. 在侧边栏中包含动态标题支持

    Unordered list:

    无序列表:

      • Support for the mixing of PHP and HTML
      • 支持混合使用PHP和HTML

      • Support for mobile browsers
      • 对移动浏览器的支持

      • Support for Google adsense including mobile
      • 支持Google adsense,包括移动设备

      • Includes support for “before post”
      • 包括对“发布前”的支持

      • Includes support for “after post”
      • 包括对“发布后”的支持

      • No limit on the number of widgets
      • 小部件数量无限制

      • Include dynamic title support in sidebars
      • 在侧边栏中包含动态标题支持

      Link to [WordPress](https://wordpress.org/ \”Your favorite software\”) and one to [Markdown\’s Syntax Documentation][markdown syntax].

      链接到[WordPress](https://wordpress.org/“您喜欢的软件”),并链接到[Markdown的语法文档] [markdown语法]。

安装步骤

    1. Extract bytes-php-code.zip to the \”/wp-content/plugins/\” directory.
    2. 将bytes-php-code.zip提取到\“ / wp-content / plugins / \”目录。

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

    5. Navigate to the widget\’s page to drag n drop a widget for use.
    6. 导航到窗口小部件的页面,将其拖放至要使用的窗口小部件。

下载地址
https://downloads.wordpress.org/plugin/byte-php-code.0.4.zip
-EOF-

AI助手支持GPT4.0