This is related to ACF Cornerstone Photography Gallery v3
I need to sort the posts for album by modified date OR by menu order. Can you tell me how to do this?
add_filter('cs_looper_custom_topcat', function($result, $args) {
// Check if 'parent_cat' is null and set it to 0 if it is
$parent_cat = isset($args['parent_cat']) ? $args['parent_cat'] : 0;
$cat_args = array(
'hide_empty' => 1,
'parent' => 0,
'taxonomy' => 'album'
);
$parentcats = get_categories($cat_args);
return $parentcats;
}, 10, 2);
add_filter('cs_looper_custom_parentcat', function($result, $args) {
// Check if 'parent_cat' is null and set it to 0 if it is
$parent_cat = isset($args['parent_cat']) ? $args['parent_cat'] : 0;
$cat_args = array(
'hide_empty' => 1,
'parent' => $parent_cat,
'taxonomy' => 'album'
);
$parentcats = get_categories($cat_args);
return $parentcats;
}, 10, 2);