"Advanced Blog Post", "category" => 'Advanced Elements', "description" => "Simple but stylish blog layouts", "base" => "awavc_blog_two", "class" => "", "icon" => "advc_blog_ico", "params" => array( array( "type" => "dropdown", "class" => "", "heading" => __("Team Box Style:", "awavcl"), "param_name" => "advc_blog_style", "value" => array( __("Style 1","awavcl") => 'blog_style_1', __("Style 2","awavcl") => 'blog_style_2', __("Style 3","awavcl") => 'blog_style_3', ), "admin_label" => true, ), array( "type" => "dropdown", "holder" => "div", "class" => "", "heading" => __("Category",'awavcl'), "param_name" => "advc_cat", "value" => awavc_dropdown_cats(), "description" => __("type the item category.",'awavcl') ), array( "type" => "dropdown", "holder" => "", "class" => "", "heading" => __("Column",'awavcl'), "param_name" => "advb_col", "value" => array( __("One Column","awavcl") => 12, __("Two Column","awavcl") => 6, __("Three Column","awavcl") => 4, __("Four Column","awavcl") => 3, __("Six Column","awavcl") => 2, ), "description" => __("Select How many post in one row.",'awavcl'), "std" => "4", ), array( "type" => "textfield", "heading" => __('Post to Show', 'awavcl'), "param_name" => "post_count", "description" => __("Put -1 for unlimited post to show", 'awavcl'), ), array( "type" => "textfield", "heading" => __('Button Text', 'awavcl'), "param_name" => "btn_text", "description" => __("specify a height and Width wheen you are using different size featured image for post", 'awavcl'), "group" => __("Button", 'awavcl'), "value" => __("Learn More", 'awavcl'), ), array( 'type' => 'prime_slider', 'heading' => __( 'Text Size', 'awavcl' ), 'param_name' => 'btn_text_size', "value" => 14, "min" => 5, "max" => 100, "step" => 1, "unit" => "px", "description" => __("Choose Title Font Size as Pixel. Default is 26px", "awavcl"), "group" => __("Button", 'awavcl'), ), array( "type" => "colorpicker", "heading" => __("Button Text Color", 'awavcl'), "param_name" => "btn_text_clr", "value" => "", "group" => __("Button", 'awavcl'), ), array( "type" => "colorpicker", "heading" => __("Button Back Color", 'awavcl'), "param_name" => "btn_bg_color", "value" => "", "group" => __("Button", 'awavcl'), ), array( "type" => "colorpicker", "heading" => __("Button Text Color on hover", 'awavcl'), "param_name" => "btn_clr_hvr", "value" => "", "group" => __("Button", 'awavcl'), ), array( 'type' => 'prime_slider', 'heading' => __( 'Image Height', 'awavcl' ), 'param_name' => 'img_hite', "value" => 250, "min" => 100, "max" => 1000, "step" => 1, "unit" => "px", "description" => __("Note:specify a height and Width wheen you are using different size featured image for post", "awavcl"), "group" => __("Settings", 'awavcl'), ), array( "type" => "textfield", "heading" => __('Image Width', 'awavcl'), "param_name" => "img_wid", "value" => "500", "description" => __("px", 'awavcl'), "group" => __("Settings", 'awavcl'), ), array( 'type' => 'prime_slider', 'heading' => __( 'Title Font Size', 'awavcl' ), 'param_name' => 'ttl_size', "value" => 18, "min" => 5, "max" => 100, "step" => 1, "unit" => "px", "description" => __("Choose Title Font Size as Pixel. Default is 16px", "awavcl"), "group" => __("Settings", 'awavcl'), ), array( "type" => "dropdown", "class" => "", "heading" => __("Title Font Weight", "awavcl"), "param_name" => "ttl_wt", "value" => array( __("Normal","awavcl") => "", __("Bold","awavcl") => "bold", __("600","awavcl") => "600", __("700","awavcl") => "700", __("900","awavcl") => "900", ), "group" => __("Settings", 'awavcl'), ), array( "type" => "dropdown", "class" => "", "heading" => __("Title Font style", "awavcl"), "param_name" => "ttl_f_style", "value" => array( __("Normal","awavcl") => "", __("Italic","awavcl") => "italic", ), "group" => __("Settings", 'awavcl'), ), array( 'type' => 'prime_slider', 'heading' => __( 'Description Size', 'awavcl' ), 'param_name' => 'desc_size', "value" => 12, "min" => 5, "max" => 100, "step" => 1, "unit" => "px", "description" => __("Choose Description Font Size as Pixel. Default is 26px", "awavcl"), "group" => __("Settings", 'awavcl'), ), array( "type" => "dropdown", "class" => "", "heading" => __("Desc Font style", "awavcl"), "param_name" => "desc_style", "value" => array( __("Normal","awavcl") => "", __("Italic","awavcl") => "italic", ), "group" => __("Settings", 'awavcl'), ), array( "type" => "colorpicker", "heading" => __("Title Color", 'awavcl'), "param_name" => "ttl_clr", "value" => "", "group" => __("Color", 'awavcl'), ), array( "type" => "colorpicker", "heading" => __("Title Color on Hover", 'awavcl'), "param_name" => "ttl_clr_hvr", "value" => "", "group" => __("Color", 'awavcl'), ), array( "type" => "colorpicker", "heading" => __("Description Color", 'awavcl'), "param_name" => "desc_clr", "value" => "", "group" => __("Color", 'awavcl'), ), array( "type" => "colorpicker", "heading" => __("Date Color", 'awavcl'), "param_name" => "date_clr", "value" => "", "group" => __("Color", 'awavcl'), ), ) )); function awavc_dropdown_cats( ) { $categories_obj = get_categories('hide_empty=0'); $categories = array(); foreach ($categories_obj as $pn_cat){ $categories[$pn_cat->cat_name] = $pn_cat->category_nicename; } $categories=array("All Categories"=>"") + $categories; return $categories; print_r($categories); } function awavc_blog_shortcode($atts, $content = null) { extract(shortcode_atts(array( //'show_btnnnn' => 'Yes', 'advc_blog_style' => 'blog_style_1', 'advc_cat' => '', 'advb_col' => '4', 'post_count' => '', 'btn_text' => 'Read More', 'btn_text_size' => '', 'btn_text_clr' => '', 'btn_bg_color' => '', 'btn_clr_hvr' => '', 'img_hite' => '250', 'img_wid' => '', 'ttl_size' => '', 'ttl_style' => '', 'ttl_wt' => '', 'desc_size' => '', 'desc_style' => '', 'ttl_clr' => '', 'ttl_clr_hvr' => '', 'desc_clr' => '', 'date_clr' => '', ), $atts)); wp_register_style( 'blog-style', plugins_url( '/css/blog-css.css', __FILE__) ); wp_enqueue_style( 'blog-style' ); //$image_url = wp_get_attachment_url( $image, 'full' ); //$image = aq_resize( $image_url, 296, 289, false ); //resize & crop the image //var_dump($image); $html = ''; $list_html = ''; $blog_query = ''; $args = array( 'post_type' => array( 'post' ),'categopry' => ''.$advc_cat.'','posts_per_page' => ''.$post_count.'',); $q = new WP_Query( $args ); if( $q->have_posts() ){ while( $q->have_posts() ): $q->the_post(); $categories = get_the_category(); if($advc_blog_style == 'blog_style_1') { $add_class = (rand(99,99999)); //The loop $html .= '
'.wp_trim_words( get_the_content(),20).'
'.$btn_text.''.wp_trim_words( get_the_content(),20).'