'service-section', 'description' => esc_html__( 'Display some pages as services.', 'foodhunt' ) );
$control_ops = array( 'width' => 200, 'height' =>250 );
parent::__construct( false, $name = esc_html__( 'TG: Service', 'foodhunt' ), $widget_ops, $control_ops);
}
function form( $instance ) {
$defaults['title'] = '';
$defaults['text'] = '';
$defaults['number'] = '3';
$defaults[ 'background_image' ] = '';
$defaults[ 'background_color' ] = '#4a4a4a';
$instance = wp_parse_args( (array) $instance, $defaults );
$title = esc_attr( $instance['title'] );
$text = esc_textarea( $instance['text'] );
$number = absint( $instance[ 'number' ] );
$background_image = esc_url_raw( $instance[ 'background_image' ] );
$background_color = esc_attr( $instance[ 'background_color' ] ); ?>
ID;
$template_name = get_post_meta( $page_id, '_wp_page_template', true );
if( $template_name == 'page-templates/template-services.php' && !in_array( $page_id , $foodhunt_duplicate_posts ) ) {
array_push( $page_array, $page_id );
}
}
$get_featured_pages = new WP_Query( array(
'posts_per_page' => $number,
'post_type' => array( 'page' ),
'post__in' => $page_array,
'orderby' => array( 'menu_order' => 'ASC', 'date' => 'DESC' )
) );
echo $before_widget;
$bg_image_class = 'no-bg-image';
$bg_image_style = '';
if ( !empty( $background_image ) ) {
$bg_image_style = 'style=background-image:url(' . esc_url( $background_image ) . ');background-repeat:no-repeat;background-size:cover;background-attachment:fixed;';
$bg_image_class = 'section-wrapper-with-bg-image';
}elseif ( $background_color != '#4a4a4a' ) {
$bg_image_style = 'style=background-color:' . esc_attr( $background_color ) . ';';
}?>
>
'; } ?>
' . esc_textarea( $text ) . '';
} ?>
have_posts() ):$get_featured_pages->the_post();
$foodhunt_duplicate_posts[] = $post->ID;
if ( $count % 3 == 0 && $count > 1 ) { echo '
'; } ?>
esc_attr( $img_alt ),
'title' => esc_attr( $title_attribute ),
); ?>