我知道以前有人问过这个问题,但是他们都在使用jQuery库,我只想使用Javascript,没有库,所以请原谅我。
这个链接显示了从jQuery调用的PHP函数。
代码调用一个显示图像的函数。
我有下面的代码,我不明白如何从mainfile.php而不是functions.php调用函数。
mainfile.php
<button id="btn">Click</btn> // button that calls ajax file
<div id="div"></div> // div where it
我使用了一个wordpress自定义的post类型滑块。我使用ajax代码--当我从任何其他页面获取数据时,它工作得很好--但是当我从用functions.php编写的自定义post类型的短代码中获得相同的数据时,就会产生问题。
there is my functions.php code
add_shortcode( 'speaker-shortcode', 'speakers_shortcode');
function speakers_shortcode( $atts ) { ?>
<section class="sp_sli
In WooCommerce、My分类列表页和产品列表页面都是从archieve-product.php (默认情况下)呈现的。如何在functions.php?中检查页面is_shop()因为is_shop函数在functions.php中不工作。我只是想从类别列表页面中删除我的侧边栏,而不是从产品列表页面中删除。
我有一个使用$get()函数检索PHP变量的脚本,但是我对每个变量有多个请求。我想要这样做,因为我希望调用是单独的,而不是等待加载所有变量。
以下是我的简单代码:
FUNCTIONS.PHP
$content1 = 'This is a good solution.';
$content2 = 'This is another good solution.';
if(preg_match('[good]', $content1)) {
$result1 = "<p>Great, we found something he
在结构化目录列表中移动文件后,我遇到了问题(我在所有文件中都使用了相对链接)。
快速概述:
www
js
functions.js
php
ajax.send.php include ('./functions.php');
ajax.delete.php include ('./functions.php');
functions.php
other dirs that have no influence
index.php include ('./php/fu
如何从位于主题functions.php中的数组获得值(std)?
$this->settings['google'] = array(
'title' => __( 'Google' ),
'desc' => __( 'This is a description for the text input.' ),
'std' => 'https://www.google.com/+profile_