shortcode_name = 'adminz_ux_pages'; $___->shortcode_title = 'Pages custom'; $___->shortcode_icon = 'text'; $___->options = function () { if (!isset($repeater_type)) $repeater_type = 'row'; if (!isset($default_text_align)) $default_text_align = 'left'; if (!isset($repeater_col_spacing)) $repeater_col_spacing = 'normal'; if (!isset($repeater_post_type)) $repeater_post_type = 'page'; if (!isset($repeater_columns)) $repeater_columns = '4'; $options = array( 'pages_options' => array( 'type' => 'group', 'heading' => __('Options'), 'options' => array( 'style' => array( 'type' => 'select', 'heading' => __('Style'), 'default' => 'normal', 'options' => require(get_template_directory() . '/inc/builder/shortcodes/values/box-layouts.php'), ), 'parent' => array( 'type' => 'select', 'heading' => 'Parent', 'default' => '', 'options' => ux_builder_get_page_parents(), ), 'multiple_level' => array( 'type' => 'checkbox', 'heading' => 'Multiple level', 'default' => 'true', ), 'orderby' => array( 'type' => 'select', 'heading' => __('Order By'), 'default' => 'menu_order', 'options' => array( 'post_title' => 'Title', 'post_date' => 'Date', 'menu_order' => 'Menu Order', 'post_modified' => 'Last Modified', ), ), 'order' => array( 'type' => 'select', 'heading' => __('Order'), 'default' => 'asc', 'options' => array( 'asc' => 'ASC', 'desc' => 'DESC', ), ), ), ), 'post_options' => array( 'type' => 'group', 'heading' => __('Custom '), 'options' => array( 'ids' => array( 'type' => 'select', 'heading' => 'Custom Pages', 'param_name' => 'ids', 'config' => array( 'multiple' => true, 'placeholder' => 'Select..', 'postSelect' => array( 'post_type' => array($repeater_post_type), ), ), ), 'heading_tag' => array( 'type' => 'select', 'heading' => __('Heading Tag'), 'default' => 'p', 'options' => array( 'p' => 'p', 'div' => 'div', 'h1' => 'h1', 'h2' => 'h2', 'h3' => 'h3', 'h4' => 'h4', 'h5' => 'h5', 'h6' => 'h6', ), ), ), ), 'layout_options' => require(get_template_directory() . '/inc/builder/shortcodes/commons/repeater-options.php'), 'post_title_options' => array( 'type' => 'group', 'heading' => __('Title'), 'options' => array( 'title_size' => array( 'type' => 'select', 'heading' => 'Title Size', 'default' => '', 'options' => require(get_template_directory() . '/inc/builder/shortcodes/values/sizes.php') ), 'title_style' => array( 'type' => 'radio-buttons', 'heading' => 'Title Style', 'default' => '', 'options' => array( '' => array('title' => 'Abc'), 'uppercase' => array('title' => 'ABC'), ), ), ), ), 'post_meta_options' => array( 'type' => 'group', 'heading' => __('Meta'), 'options' => array( 'excerpt' => array( 'type' => 'select', 'heading' => 'Excerpt', 'default' => 'visible', 'options' => array( 'visible' => 'Visible', 'fade' => 'Fade In On Hover', 'slide' => 'Slide In On Hover', 'reveal' => 'Reveal On Hover', 'false' => 'Hidden', ), ), 'excerpt_length' => array( 'type' => 'slider', 'heading' => 'Excerpt Length', 'default' => 15, 'max' => 50, 'min' => 5, ), ), ), 'read_more_button' => array( 'type' => 'group', 'heading' => __('Read More'), 'options' => array( 'readmore' => array( 'type' => 'textfield', 'heading' => 'Text', 'default' => '', ), 'readmore_color' => array( 'type' => 'select', 'heading' => 'Color', 'conditions' => 'readmore', 'default' => '', 'options' => array( '' => 'Default', 'primary' => 'Primary', 'secondary' => 'Secondary', 'alert' => 'Alert', 'success' => 'Success', 'white' => 'White', ), ), 'readmore_style' => array( 'type' => 'select', 'heading' => 'Style', 'conditions' => 'readmore', 'default' => 'outline', 'options' => array( '' => 'Default', 'outline' => 'Outline', 'link' => 'Simple', 'underline' => 'Underline', 'shade' => 'Shade', 'bevel' => 'Bevel', 'gloss' => 'Gloss', ), ), 'readmore_size' => array( 'type' => 'select', 'conditions' => 'readmore', 'heading' => 'Size', 'default' => '', 'options' => require(get_template_directory() . '/inc/builder/shortcodes/values/sizes.php'), ), ), ), 'layout_options_slider' => require(get_template_directory() . '/inc/builder/shortcodes/commons/repeater-slider.php'), ); $box_styles = require(get_template_directory() . '/inc/builder/shortcodes/commons/box-styles.php'); $options = array_merge($options, $box_styles); $advanced = array('advanced_options' => require(get_template_directory() . '/inc/builder/shortcodes/commons/advanced.php')); $options = array_merge($options, $advanced); return $options; }; $___->shortcode_scripts = array('flatsome-masonry-js' => get_template_directory_uri() . '/assets/libs/packery.pkgd.min.js',); $___->shortcode_presets = array( array( 'name' => __('Default'), 'content' => '[adminz_ux_pages]', ), ); $___->shortcode_callback = function ($atts) { extract(shortcode_atts(array( // meta '_id' => 'pages-' . rand(), 'class' => '', 'visibility' => '', 'parent' => '', 'orderby' => 'menu_order', 'order' => 'asc', 'ids' => false, 'heading_tag' => 'p', 'target' => '', 'multiple_level' => "true", // Layout 'style' => '', 'columns' => '4', 'columns__md' => '', 'columns__sm' => '', 'col_spacing' => '', 'type' => 'row', // slider, row, masonery, grid 'width' => '', 'grid' => '1', 'grid_height' => '600px', 'grid_height__md' => '500px', 'grid_height__sm' => '400px', 'slider_nav_style' => 'reveal', 'slider_nav_position' => '', 'slider_nav_color' => '', 'slider_bullets' => 'false', 'slider_arrows' => 'true', 'auto_slide' => 'false', 'infinitive' => 'true', 'depth' => '', 'depth_hover' => '', // Read more 'readmore' => '', 'readmore_color' => '', 'readmore_style' => 'outline', 'readmore_size' => 'small', //Title 'title_size' => '', 'title_style' => '', //excerpt 'excerpt' => 'visible', 'excerpt_length' => 15, // Box styles 'animate' => '', 'text_pos' => '', 'text_padding' => '', 'text_bg' => '', 'text_color' => '', 'text_hover' => '', 'text_align' => 'left', 'text_size' => '', 'image_size' => 'medium', 'image_mask' => '', 'image_width' => '', 'image_height' => '', 'image_radius' => '', 'image_hover' => '', 'image_hover_alt' => '', 'image_overlay' => '', ), $atts)); ob_start(); echo '
Sorry, no pages was found
'; $classes_box = array('page-box', 'box', 'has-hover'); $classes_image = array('box-image'); $classes_text = array('box-text'); // Create Grid if ($type == 'grid') { if (!$text_pos) $text_pos = 'center'; if (!$text_color) $text_color = 'dark'; // if($style !== 'shade') $style = 'overlay'; Why? $columns = 0; $current_grid = 0; // $grid = flatsome_get_grid($grid); $grid = apply_filters('adminz_flatsome_get_grid', flatsome_get_grid($grid), $grid); $grid_total = count($grid); flatsome_get_grid_height($grid_height, $_id); } // Add Animations if ($animate) { $animate = 'data-animate="' . $animate . '"'; } // Set box style if ($style) $classes_box[] = 'box-' . $style; if ($style == 'overlay') $classes_box[] = 'dark'; if ($style == 'shade') $classes_box[] = 'dark'; if ($style == 'badge') $classes_box[] = 'hover-dark'; if ($text_pos) $classes_box[] = 'box-text-' . $text_pos; if ($style == 'overlay' && !$image_overlay) $image_overlay = 'rgba(0,0,0,.3)'; // Set image styles if ($image_hover) $classes_image[] = 'image-' . $image_hover; if ($image_hover_alt) $classes_image[] = 'image-' . $image_hover_alt; if ($image_height) $classes_image[] = 'image-cover'; // Text classes if ($text_hover) $classes_text[] = 'show-on-hover hover-' . $text_hover; if ($text_align) $classes_text[] = 'text-' . $text_align; if ($text_size) $classes_text[] = 'is-' . $text_size; if ($text_color == 'dark') $classes_text[] = 'dark'; $css_col = array( array('attribute' => 'border-radius', 'value' => $image_radius, 'unit' => '%'), ); $css_args_img = array( array('attribute' => 'border-radius', 'value' => $image_radius, 'unit' => '%'), array('attribute' => 'width', 'value' => $image_width, 'unit' => '%'), ); $css_args = array( array('attribute' => 'background-color', 'value' => $text_bg), array('attribute' => 'padding', 'value' => $text_padding), ); $css_image_height = array( array('attribute' => 'padding-top', 'value' => $image_height), ); // Repeater options $repeater['id'] = $_id; $repeater['type'] = $type; $repeater['style'] = $style; $repeater['class'] = $class; $repeater['visibility'] = $visibility; $repeater['slider_style'] = $slider_nav_style; $repeater['slider_nav_color'] = $slider_nav_color; $repeater['slider_nav_position'] = $slider_nav_position; $repeater['slider_bullets'] = $slider_bullets; $repeater['auto_slide'] = $auto_slide; $repeater['infinitive'] = $infinitive; $repeater['row_spacing'] = $col_spacing; $repeater['row_width'] = $width; $repeater['columns'] = $columns; $repeater['columns__md'] = $columns__md; $repeater['columns__sm'] = $columns__sm; $repeater['depth'] = $depth; $repeater['depth_hover'] = $depth_hover; get_flatsome_repeater_start($repeater); foreach ($childpages as $page) { $classes_col = array('page-col', 'col'); $show_excerpt = $excerpt; if ($type == 'grid') { if ($grid_total > $current_grid) $current_grid++; $current = $current_grid - 1; $classes_col[] = 'grid-col'; if ($grid[$current]['height']) $classes_col[] = 'grid-col-' . $grid[$current]['height']; if ($grid[$current]['span']) $classes_col[] = 'large-' . $grid[$current]['span']; if ($grid[$current]['md']) $classes_col[] = 'medium-' . $grid[$current]['md']; // Set image size if ($grid[$current]['size'] == 'large') $image_size = 'large'; if ($grid[$current]['size'] == 'medium') $image_size = 'medium'; } ?> '; echo '