PHP code example of yogigr / wpthemeapi
1. Go to this page and download the library: Download yogigr/wpthemeapi library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
yogigr / wpthemeapi example snippets
use yogigr\WpThemeApi\Facades\WpThemeApi;
$categories = WpThemeApi::categories();
foreach ($categories as $category) {
echo $category['name'] . ' - ' . $category['path'] . PHP_EOL;
}
use yogigr\WpThemeApi\Facades\WpThemeApi;
$items = WpThemeApi::items();
foreach ($items['themes'] as $item) {
echo $item['name'] . ' - ' . $item['price_cents'] / 100 . ' USD' . PHP_EOL;
}
bash
php artisan vendor:publish --provider="yogigr\WpThemeApi\Providers\WpThemeApiServiceProvider"