"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', __("Style 4","awavcl") => 'blog_style_4', __("Style 5","awavcl") => 'blog_style_5', __("Style 6","awavcl") => 'blog_style_6', __("Style 7","awavcl") => 'blog_style_7', __("Style 8","awavcl") => 'blog_style_8', __("Style 9","awavcl") => 'blog_style_9', ), "admin_label" => true, "description" => __("Important Note: Please define content box (title/desc box ) height from setting",'awavcl') ), 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' => __( 'Content Height', 'awavcl' ), 'param_name' => 'content_hite', "value" => 250, "min" => 100, "max" => 1000, "step" => 1, "unit" => "px", "description" => __("Note:Content box height should be ", "awavcl"), "group" => __("Settings", '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" => "textfield", "heading" => __('Description/Exerpt Word to Show', 'awavcl'), "param_name" => "exp_count", "description" => __("Default is 20", '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' => 'prime_slider', 'heading' => __( 'Margin Buttom', 'awavcl' ), 'param_name' => 'pd_btm', "value" => 50, "min" => 5, "max" => 100, "step" => 1, "unit" => "px", "description" => __("Gap between rows", "awavcl"), "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" => __("Meta Tag Background", 'awavcl'), "param_name" => "meta_bg", "value" => "", "group" => __("Color", 'awavcl'), "dependency" => array( 'element' => "news_ticker", 'value' => array('blog_style_8',) ), ), array( "type" => "colorpicker", "heading" => __("Meta Tag Color", 'awavcl'), "param_name" => "meta_clr", "value" => "", "group" => __("Color", 'awavcl'), "dependency" => array( 'element' => "news_ticker", 'value' => array('blog_style_8',) ), ), array( "type" => "colorpicker", "heading" => __("Date Color", 'awavcl'), "param_name" => "date_clr", "value" => "", "group" => __("Color", 'awavcl'), ), array( "type" => "textfield", "heading" => __('Extra Class', 'awavcl'), "param_name" => "el_class", "description" => __("give a extra class to style if need", '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', 'exp_count' => '20', 'img_wid' => '', 'ttl_size' => '', 'ttl_style' => '', 'ttl_wt' => '', 'desc_size' => '', 'desc_style' => '', 'ttl_clr' => '', 'ttl_clr_hvr' => '', 'desc_clr' => '', 'date_clr' => '', 'pd_btm' => '', 'content_hite' => '270', 'meta_bg' => '', 'meta_clr' => '', 'el_class' => '', ), $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 .= '
'.get_the_author().' / '.get_the_date('M d,Y').' || '.$categories[0]->cat_name.'

'.get_the_title().'

'.wp_trim_words( get_the_content(),$exp_count).'

'.$btn_text.'
'; } if($advc_blog_style == 'blog_style_2') { $add_class = (rand(99,99999)); //The loop $html .= '

'.get_the_title().'

'.wp_trim_words( get_the_content(),$exp_count).'

'; } if($advc_blog_style == 'blog_style_3') { $add_class = (rand(99,99999)); $get_author_id = get_the_author_meta('ID'); $get_author_gravatar = get_avatar_url($get_author_id, array('size' => 450)); //The loop $html .= '
blog grid image

'.get_the_title().'

'.wp_trim_words( get_the_content(),$exp_count).'

'; } if($advc_blog_style == 'blog_style_4') { $add_class = (rand(99,99999)); $get_author_id = get_the_author_meta('ID'); $get_author_gravatar = get_avatar_url($get_author_id, array('size' => 450)); //The loop $html .= '

'.get_the_title().'

'.wp_trim_words( get_the_content(),$exp_count).'

'.$btn_text.'
'; } if($advc_blog_style == 'blog_style_5') { $add_class = (rand(99,99999)); $get_author_id = get_the_author_meta('ID'); $get_author_gravatar = get_avatar_url($get_author_id, array('size' => 450)); //The loop $html .= '

'.get_the_title().'

'.wp_trim_words( get_the_content(),$exp_count).'

'.$btn_text.'
'; } if($advc_blog_style == 'blog_style_6') { $add_class = (rand(99,99999)); $get_author_id = get_the_author_meta('ID'); $get_author_gravatar = get_avatar_url($get_author_id, array('size' => 450)); //The loop $html .= '
'; } if($advc_blog_style == 'blog_style_7') { $add_class = (rand(99,99999)); $get_author_id = get_the_author_meta('ID'); $get_author_gravatar = get_avatar_url($get_author_id, array('size' => 450)); //The loop $html .= '

'.get_the_title().'

'.wp_trim_words( get_the_content(),$exp_count).'

'.$btn_text.'
'; } if($advc_blog_style == 'blog_style_8') { $add_class = (rand(99,99999)); $get_author_id = get_the_author_meta('ID'); $get_author_gravatar = get_avatar_url($get_author_id, array('size' => 450)); //The loop $html .= '

'.get_the_title().'

'.wp_trim_words( get_the_content(),$exp_count).'

'; } if($advc_blog_style == 'blog_style_9') { $add_class = (rand(99,99999)); $get_author_id = get_the_author_meta('ID'); $get_author_gravatar = get_avatar_url($get_author_id, array('size' => 450)); //The loop $html .= '

'.get_the_title().'

'.wp_trim_words( get_the_content(),$exp_count).'

'.$btn_text.'
'; } endwhile; $html .= ' '; } return $html; } add_shortcode("awavc_blog_two", "awavc_blog_shortcode");