{{content_title}}

{{category_selection}}
'; $frontCss = '.cat_mod_l{float:left;margin-right: 10px;} .cat_mod ul{padding:0;list-style-type:none} .cat_mod li {display:inline-block;width:100%;margin-bottom:15px;} .cat_mod li amp-img{ max-width:100px; width:100px;} .cat_mod p{margin-bottom: 0;font-size: 14px;line-height: 1.5;}'; $categories = get_categories( array( 'orderby' => 'name', 'order' => 'ASC' ) ); $categoriesArray = array('recent_option'=>'Recent Posts'); $options = ''; foreach($categories as $category){ $categoriesArray[$category->term_id] = $category->name; $options.= ''; } return array( 'label' =>'Category', 'name' => 'contents', 'fields' => array( array( 'type' =>'text', 'name' =>"content_title", 'label' =>'Category Block Title', 'default' =>'Category', ), array( 'type' =>'select', 'name'=>"category_selection", 'label'=>"Select Category", 'default'=>'recent_option', 'options' => $options, 'options_details'=>$categoriesArray ), array( 'type' =>'text', 'name' =>"show_total_posts", 'label' =>'Count', 'default' =>'3', ), array( 'type' =>'select', 'name' =>"ampforwp_show_excerpt", 'label' =>"Excerpt", 'default' =>'yes', 'options' => '', 'options_details'=>array('yes'=>'Yes', 'no'=>'No') ) ), 'front_template'=> $output, 'front_css'=>$frontCss, ); function contentHtml($the_query,$fieldValues){ $contenthtml = ''; $ampforwp_show_excerpt = (isset($fieldValues['ampforwp_show_excerpt'])? $fieldValues['ampforwp_show_excerpt']: 'yes'); if ( $the_query->have_posts() ) { $contenthtml.= ''; } /* Restore original Post Data */ wp_reset_postdata(); return $contenthtml; }