Created
February 21, 2022 00:55
-
-
Save webmasterninjay/43d4fcf6d0416d2c0f522f9985b0c764 to your computer and use it in GitHub Desktop.
Genesis Framework: Use genesis_custom_loop as shortcode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_shortcode( 'cibaria_loop', 'cibaria_loop_shortcode' ); | |
function cibaria_loop_shortcode( $atts ) { | |
$param = shortcode_atts( [ | |
'post_status' => 'publish', | |
'post_type' => 'post', | |
'orderby' => 'date', | |
'order' => 'DESC', | |
'posts_per_page' => -1, | |
], $atts ); | |
$args = [ | |
'post_status' => $param['post_status'], | |
'post_type' => $param['post_type'], | |
'orderby' => $param['orderby'], | |
'order' => $param['order'], | |
'posts_per_page' => $param['posts_per_page'], | |
]; | |
ob_start(); | |
genesis_custom_loop( $args ); | |
$item = ob_get_clean(); | |
return $item; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment