Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions admin/shortcodes/shortcodes/my_mini_posts_grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ frameworkShortcodeAtts={
defaultText: 'left',
help:"Alignment of grid - left, right, or center."
},
{
label:"Display only child posts",
id:"only_child_posts",
controlType:"select-control",
selectValues:['yes', 'no'],
defaultValue: 'no',
defaultText: 'no',
help:"Display only child posts of the current post."
},
{
label:"Custom class",
id:"custom_class",
Expand Down
9 changes: 9 additions & 0 deletions admin/shortcodes/shortcodes/my_mini_posts_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ frameworkShortcodeAtts={
id:"excerpt_count",
help:"How many words are displayed in the excerpt?"
},
{
label:"Display only child posts",
id:"only_child_posts",
controlType:"select-control",
selectValues:['yes', 'no'],
defaultValue: 'no',
defaultText: 'no',
help:"Display only child posts of the current post."
},
{
label:"Custom class",
id:"custom_class",
Expand Down
9 changes: 9 additions & 0 deletions admin/shortcodes/shortcodes/my_posts_grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ frameworkShortcodeAtts={
id:"tag",
help:"Enter tags for posts filtering. Leave blank to pull all tags"
},
{
label:"Display only child posts",
id:"only_child_posts",
controlType:"select-control",
selectValues:['yes', 'no'],
defaultValue: 'no',
defaultText: 'no',
help:"Display only child posts of the current post."
},
{
label:"Custom class",
id:"custom_class",
Expand Down
11 changes: 10 additions & 1 deletion admin/shortcodes/shortcodes/my_posts_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ frameworkShortcodeAtts={
id:"tag",
help:"Enter tags for posts filtering. Leave blank to pull all tags"
},
{
label:"Display only child posts",
id:"only_child_posts",
controlType:"select-control",
selectValues:['yes', 'no'],
defaultValue: 'no',
defaultText: 'no',
help:"Display only child posts of the current post."
},
{
label:"Tags",
id:"tags",
Expand All @@ -93,4 +102,4 @@ frameworkShortcodeAtts={
defaultContent:"",
shortcode:"posts_list",
shortcodeType: "text-replace"
};
};
25 changes: 15 additions & 10 deletions includes/shortcodes/mini-posts-grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@
if (!function_exists('mini_posts_grid_shortcode')) {
function mini_posts_grid_shortcode( $atts, $content = null, $shortcodename = '' ) {
extract(shortcode_atts(array(
'type' => 'post',
'type' => 'post',
'category' => '',
'custom_category' => '',
'numb' => '8',
'thumbs' => '',
'thumb_width' => '',
'thumb_height' => '',
'lightbox' => 'yes',
'order_by' => 'date',
'order' => 'DESC',
'align' => '',
'custom_class' => ''
'numb' => '8',
'thumbs' => '',
'thumb_width' => '',
'thumb_height' => '',
'lightbox' => 'yes',
'order_by' => 'date',
'order' => 'DESC',
'align' => '',
'custom_class' => '',
'only_child_posts' => ''
), $atts));

$template_url = get_stylesheet_directory_uri();
Expand Down Expand Up @@ -88,6 +89,10 @@ function mini_posts_grid_shortcode( $atts, $content = null, $shortcodename = ''
'suppress_filters' => $suppress_filters
);

if ($only_child_posts == 'yes') {
$args['post_parent'] = $post->ID;
}

$posts = get_posts($args);
$i = 0;

Expand Down
25 changes: 15 additions & 10 deletions includes/shortcodes/mini-posts-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@

function mini_posts_list_shortcode( $atts, $content = null, $shortcodename = '' ) {
extract(shortcode_atts(array(
'type' => 'post',
'numb' => '3',
'thumbs' => '',
'thumb_width' => '',
'thumb_height' => '',
'meta' => '',
'order_by' => '',
'order' => '',
'excerpt_count' => '0',
'custom_class' => ''
'type' => 'post',
'numb' => '3',
'thumbs' => '',
'thumb_width' => '',
'thumb_height' => '',
'meta' => '',
'order_by' => '',
'order' => '',
'excerpt_count' => '0',
'custom_class' => '',
'only_child_posts' => ''
), $atts));

$template_url = get_template_directory_uri();
Expand Down Expand Up @@ -85,6 +86,10 @@ function mini_posts_list_shortcode( $atts, $content = null, $shortcodename = ''
'suppress_filters' => $suppress_filters
);

if ($only_child_posts == 'yes') {
$args['post_parent'] = $post->ID;
}

$posts = get_posts($args);
$i = 0;

Expand Down
37 changes: 21 additions & 16 deletions includes/shortcodes/posts-grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,23 @@

function posts_grid_shortcode( $atts, $content = null, $shortcodename = '' ) {
extract(shortcode_atts(array(
'type' => 'post',
'category' => '',
'custom_category' => '',
'tag' => '',
'columns' => '3',
'rows' => '3',
'order_by' => 'date',
'order' => 'DESC',
'thumb_width' => '370',
'thumb_height' => '250',
'lightbox' => 'yes',
'meta' => '',
'excerpt_count' => '15',
'link' => 'yes',
'link_text' => __('Read more', CHERRY_PLUGIN_DOMAIN),
'custom_class' => ''
'type' => 'post',
'category' => '',
'custom_category' => '',
'tag' => '',
'columns' => '3',
'rows' => '3',
'order_by' => 'date',
'order' => 'DESC',
'thumb_width' => '370',
'thumb_height' => '250',
'lightbox' => 'yes',
'meta' => '',
'excerpt_count' => '15',
'link' => 'yes',
'link_text' => __('Read more', CHERRY_PLUGIN_DOMAIN),
'custom_class' => '',
'only_child_posts' => ''
), $atts));

$spans = $columns;
Expand Down Expand Up @@ -102,6 +103,10 @@ function posts_grid_shortcode( $atts, $content = null, $shortcodename = '' ) {
'suppress_filters' => $suppress_filters
);

if ($only_child_posts == 'yes') {
$args['post_parent'] = $post->ID;
}

$posts = get_posts( $args );

if ( empty( $posts ) ) {
Expand Down
31 changes: 18 additions & 13 deletions includes/shortcodes/posts-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@

function posts_list_shortcode( $atts, $content = null, $shortcodename = '' ) {
extract(shortcode_atts(array(
'type' => 'post',
'thumbs' => '',
'thumb_width' => '',
'thumb_height' => '',
'post_content' => '',
'numb' => '5',
'order_by' => '',
'order' => '',
'link' => '',
'link_text' => __('Read more', CHERRY_PLUGIN_DOMAIN),
'tag' => '',
'tags' => '',
'custom_class' => ''
'type' => 'post',
'thumbs' => '',
'thumb_width' => '',
'thumb_height' => '',
'post_content' => '',
'numb' => '5',
'order_by' => '',
'order' => '',
'link' => '',
'link_text' => __('Read more', CHERRY_PLUGIN_DOMAIN),
'tag' => '',
'tags' => '',
'custom_class' => '',
'only_child_posts' => '',
), $atts));

// check what order by method user selected
Expand Down Expand Up @@ -64,6 +65,10 @@ function posts_list_shortcode( $atts, $content = null, $shortcodename = '' ) {
'suppress_filters' => $suppress_filters
);

if ($only_child_posts == 'yes') {
$args['post_parent'] = $post->ID;
}

$posts = get_posts($args);
$i = 0;

Expand Down