Skip to content

Instantly share code, notes, and snippets.

@sokratesagogo
Created August 28, 2023 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sokratesagogo/5cf0e8c8cc0d1db03a0b128b6d87c8e9 to your computer and use it in GitHub Desktop.
Save sokratesagogo/5cf0e8c8cc0d1db03a0b128b6d87c8e9 to your computer and use it in GitHub Desktop.
Add page parent to BS-Isotope shortcode parameters
ob_start();
extract(shortcode_atts(array(
'terms_parent' => '',
'type' => '',
'order' => 'date',
'orderby' => 'date',
'posts' => -1,
'tax' => '',
'terms' => '',
'post_parent' => ''
), $atts));
$options = array(
'order' => $order,
'orderby' => $orderby,
'posts_per_page' => $posts,
'post_type' => 'post',
);
// Page Parent
$post_parent= trim($post_parent);
if ($post_parent!= '' ) {
$options['post_parent'] = $post_parent;
}
@crftwrk
Copy link

crftwrk commented Sep 19, 2023

I'm trying to implement your feature but can't get it to work. Can you share the entire template and a sample shortcode?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment