Skip to content

Instantly share code, notes, and snippets.

@sc0ttkclark
sc0ttkclark / custom-pods-shortcode-total-text.php
Last active May 28, 2019 02:44
Custom `[pods]` shortcode handling for total text.
<?php
/*
* Ensure total_found() gets calculated right away, because in the [pods] shortcode
* it does other queries after the initial find().
*/
add_filter( 'pods_data_auto_calculate_total_found', '__return_true' );
/**
* Add custom shortcode handling for total text.
@Shelob9
Shelob9 / 1-pods-loop-general-example.php
Last active April 9, 2025 15:01
Pods Looping Examples.
<?php
//set up pods::find parameters to limit to 5 items
$param = array(
'limit' => 5,
);
//create pods object
$pods = pods('pod_name', $params );
//check that total values (given limit) returned is greater than zero
if ( $pods->total() > 0 ) {