CodeIgniterからWordprssを呼び出した際に苦労したから、FuelPHPからはどうだろうと思いやってみた。
とりあえずということでまずは投稿された記事が呼び出せるか?(ってか、まだこれしかしてない)
まずは、フォルダの構成。あまり深く考えず、ドキュメントルートにwordpressを置いてみた。

ドキュメントルートの名前はwpplus(適当)

wp_1

 

この状態でwordpressのインストールを実行。

 

次に、 /fuel/app/bootstrap.php の編集を行う。
ポイントは3行目の「 require ‘../wordpress/wp-load.php’; 」の部分。
10行目の「require COREPATH.’classes’.DIRECTORY_SEPARATOR.’autoloader.php’; 」の部分より、
前に呼び出す必要がある。

<?php

require '../wordpress/wp-load.php';

// Load in the Autoloader
require COREPATH.'classes'.DIRECTORY_SEPARATOR.'autoloader.php';
class_alias('Fuel\\Core\\Autoloader', 'Autoloader');

// Bootstrap the framework DO NOT edit this
require COREPATH.'bootstrap.php';
Autoloader::add_classes(array(
// Add classes you want to override here
// Example: 'View' => APPPATH.'classes/view.php',
));

// Register the autoloader
Autoloader::register();

/**
* Your environment. Can be set to any of the following:
*
* Fuel::DEVELOPMENT
* Fuel::TEST
* Fuel::STAGING
* Fuel::PRODUCTION
*/
Fuel::$env = (isset($_SERVER['FUEL_ENV']) ? $_SERVER['FUEL_ENV'] : Fuel::DEVELOPMENT);

// Initialize the framework with the config file.
Fuel::init('config.php');

次に、Controllerの作成。
ポイントは9行目の「 require_once ‘../wordpress/wp-blog-header.php’; 」の部分。
後はWordpressの関数を呼び出すことで記事の一覧を取得出来る。


というわけで、非常に簡単でした。

167 Comments

  1. search.gmx.comwebresult?q="My Canadian Pharmacy - Extensive Assortment of Medications – 2022" says:

    Viagra cost https://search.gmx.com/web/result?q=“My Canadian Pharmacy – Extensive Assortment of Medications – 2022”

    With thanks! Great stuff.

  2. https://search.seznam.cz/?q="My Canadian Pharmacy - Extensive Assortment of Medications – 2022" says:

    Viagra generika https://search.seznam.cz/?q=“My Canadian Pharmacy – Extensive Assortment of Medications – 2022”

    Lovely forum posts, Thank you!

  3. stromectol cream says:

    stromectol biam https://sanangelolive.com/members/unsafiri

    Seriously quite a lot of beneficial tips!

  4. canadian mail order pharmacies says:

    no 1 canadian pharcharmy online https://swisscows.com/en/web?query=“My Canadian Pharmacy – Extensive Assortment of Medications – 2022”

    Appreciate it! Plenty of data!

  5. www.dogpile.comserp?q="My Canadian Pharmacy - Extensive Assortment of Medications – 2022" says:

    Tadalafil https://www.dogpile.com/serp?q=“My Canadian Pharmacy – Extensive Assortment of Medications – 2022”

    You said it perfectly..

  6. https://search.naver.com/search.naver?where=nexearch says:

    Viagra 20 mg best price

    Thanks! Quite a lot of tips.

  7. https://search.givewater.com/serp?q="My Canadian Pharmacy - Extensive Assortment of Medications – 2022" says:

    How does viagra work https://search.givewater.com/serp?q=“My Canadian Pharmacy – Extensive Assortment of Medications – 2022”

    Good write ups, Kudos.

  8. canada online pharmacy says:

    best canadian pharmacy https://www.bakespace.com/members/profile/Сanadian pharmaceuticals for usa sales/1541108/

    Nicely put. Kudos.

  9. Northwest Pharmacy says:

    canadian pharmacy cialis https://results.excite.com/serp?q=“My Canadian Pharmacy – Extensive Assortment of Medications – 2022”

    You revealed it terrifically.

  10. buy viagra now says:

    best canadian pharmacies online https://www.infospace.com/serp?q=“My Canadian Pharmacy – Extensive Assortment of Medications – 2022”

    Amazing lots of great facts!

Leave a Reply