小编Jan*_*Jan的帖子

什么使Wordpress主题成为"无效的父主题"?

为了覆盖现有Wordpress主题的一些CSS,我想按照http://codex.wordpress.org/Child_Themes#Example_of_a_basic_Child_Theme中的描述创建它的子主题.

我创建了一个目录以及style.css文件,其中父主题的名称被定义为"模板".到现在为止还挺好.当我转到Wordpress管理中的主题页面时,我收到消息"[父主题的名称]主题不是有效的父主题.",我无法激活它.

我想知道Wordpress如何找出父主题是否有效以及是否有办法使父主题成为有效的父主题.

为了找出定义的父主题是否是问题,我将"模板"定义替换为另一个主题,该主题也安装在同一台服务器上,并且有效.

在此先感谢您的帮助.

wordpress themes

8
推荐指数
1
解决办法
2741
查看次数

需要帮助使用Google API Client Library for PHP创建QPX Express请求

我想找到特价航班的最低价格,并希望使用Google Developers提供的QPX Express API.由于我是PHP开发人员,我认为用于PHPGoogle API客户端库是我的首选方法.

但是,在使用QPX Express API组合PHP API时,我感到困惑:

关于QPX Express,我知道我必须创建一个必须发送到API的JSON对象,甚至可以通过https://qpx-express-demo.itasoftware.com/上的Demo轻松完成.

关于PHP API客户端,我想我必须创建一个Client对象和QPX Express Service对象,如下所示:

require_once 'Google/Client.php';
require_once 'Google/Service/QPXExpress.php';
$client = new Google_Client();
$client->setApplicationName("Testing");
$client->setDeveloperKey("MY_APP_KEY");
$service = new Google_Service_QPXExpress($client);
Run Code Online (Sandbox Code Playgroud)

(我已经在Google Developers Console中创建了一个新项目和一个API KEY.)

但后来我不知道该怎么用它来发送JSON请求并收到JSON响应.我要么找不到正确的资源,要么我对RESTful API缺乏了解......不幸的是,我没有找到类似于特殊情况的教程(PHP API和QPX),简单的例子没有多大帮助, QPX Express参考文献也没有.所以,我希望有人能把我放在正确的轨道上...提前致谢!

更新:ämbi的第一个答案的帮助下,我想出了以下代码,导致致命错误.

代码:

require_once 'Client.php';
require_once 'Service/QPXExpress.php';
$client = new Google_Client();
$client->setApplicationName("Testing");
$client->setDeveloperKey("[myKey]");
$service = new Google_Service_QPXExpress($client);
$request = new Google_Service_QPXExpress_TripOptionsRequest();
$request->setMaxPrice('EUR200');
$searchRequest = new Google_Service_QPXExpress_TripsSearchRequest();
$searchRequest->setRequest($request);
$result = $service->trips->search($searchRequest); …
Run Code Online (Sandbox Code Playgroud)

php api json google-api-php-client

1
推荐指数
1
解决办法
5900
查看次数

标签 统计

api ×1

google-api-php-client ×1

json ×1

php ×1

themes ×1

wordpress ×1