PHP code example of page-carbajal / wpexpress-query
1. Go to this page and download the library: Download page-carbajal/wpexpress-query 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/ */
page-carbajal / wpexpress-query example snippets
function getFiveBooksPermalinks()
{
$list = array();
$fiveBooks = Query::Custom('book')->limit(5)->get();
foreach($fiveBooks as $post)
{
$list[] = get_permalink($post->ID);
}
return $list;
}
$Posts = Posts()->limit(5)->get();
foreach($Posts as $post)
{
// TODO: Write your code here
}