PHP code example of sectsect / cfs-loop-field-query
1. Go to this page and download the library: Download sectsect/cfs-loop-field-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/ */
php
$ary = array();
$args = array(
'posts_per_page' => -1,
'calendar' => true // Get the data for Not from the day but from the first day of the month.
);
$query = new CFS_LFQ_Query( $args );
if ( $query->have_posts() ) { while ( $query->have_posts() ) { $query->the_post();
$date = date( 'Ymd', strtotime( $post->date ) );
$post_id = $post->ID;
$perm = get_the_permalink();
$title = get_the_title();
array_push( $ary, array('date' => $date, 'id' => $post_id, 'permlink' => $perm, 'title' => $title) );
}}
wp_reset_postdata();
// Passing array to your Calendar Class.