blocklab post loop
<?php
$args = array(
'post_type' => block_field('post-type', false),
'posts_per_page' => block_field('num-posts', false),
/*'tax_query' => array(
array(
'taxonomy' => block_field('taxonomy-name', false),
'field' => 'slug',
'terms' => block_field('taxonomy-parameter', false),
),
),*/
'paged' => 1,
'orderby' => 'date',
'order' => 'DESC',
);
// The Query
$the_query = new WP_Query( $args );
// The Loop
if ( $the_query->have_posts() ) {
while ( $the_query->have_posts() ) {
$the_query->the_post();
?>
<!-- WHATEVER... you are in the WP LOOP! -->
<?php
}
/* Restore original Post Data */
wp_reset_postdata();
} else {
// no posts found
echo "No posts";
}
?>
Also in PHP:
- date method php
- find data format in php
- data validation of $_POST in php
- count variable lenth in php
- check a string for a string php
- date format in ph
- base64_decode($str header: location
- check if key exists in dictionary php
- Seeding Laravel
- codeigniter check view file exists
- check if there is string in string php
- check string variable length php
- add days in datetime php
- echo in json format php
- Route pattern cannot reference variable name more than once. laravel
- Decode from Base64 format php
- default port for phpmyadmin
- DateTime::add() php
- error reporting panvil.works
- carbon now format
- Create image data URIs (base64) using PHP Raw
- array_key_exists($x, $p)
- add day to time php
- display errr php