__( 'Left Sidebar', 'attitude' ), 'id' => 'attitude_left_sidebar', 'description' => __( 'Shows widgets at Left side.', 'attitude' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

' ) ); // Registering main right sidebar register_sidebar( array( 'name' => __( 'Right Sidebar', 'attitude' ), 'id' => 'attitude_right_sidebar', 'description' => __( 'Shows widgets at Right side.', 'attitude' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

' ) ); // Registering Business Page template sidebar register_sidebar( array( 'name' => __( 'Business Page Sidebar', 'attitude' ), 'id' => 'attitude_business_page_sidebar', 'description' => __( 'Shows widgets on Business Page Template. Sutiable widget: Theme Horse: Featured widget, Theme Horse: Testimonial, Theme Horse: Services', 'attitude' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ) ); // Registering contact Page sidebar register_sidebar( array( 'name' => __( 'Contact Page Sidebar', 'attitude' ), 'id' => 'attitude_contact_page_sidebar', 'description' => __( 'Shows widgets on Contact Page Template.', 'attitude' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

' ) ); // Registering footer sidebar register_sidebar( array( 'name' => __( 'Footer Sidebar', 'attitude' ), 'id' => 'attitude_footer_sidebar', 'description' => __( 'Shows widgets at footer.', 'attitude' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

' ) ); // Registering widgets register_widget( "attitude_custom_tag_widget" ); register_widget( "attitude_service_widget" ); register_widget( "attitude_recent_work_widget" ); register_widget( "attitude_Widget_Testimonial" ); register_widget( "attitude_promobox_widget" ); } /****************************************************************************************/ /** * Extends class wp_widget * * Creates a function CustomTagWidget * $widget_ops option array passed to wp_register_sidebar_widget(). * $control_ops option array passed to wp_register_widget_control(). * $name, Name for this widget which appear on widget bar. */ class attitude_custom_tag_widget extends WP_Widget { function __construct() { $widget_ops = array( 'classname' => 'widget_custom-tagcloud', 'description' => __( 'Displays Custom Tag Cloud', 'attitude' ) ); $control_ops = array('width' => 200, 'height' => 250); parent::__construct( false, $name = __( 'Theme Horse: Custom Tag Cloud', 'attitude' ), $widget_ops, $control_ops ); } /** Displays the Widget in the front-end. * * $args Display arguments including before_title, after_title, before_widget, and after_widget. * $instance The settings for the particular instance of the widget */ function widget( $args, $instance ) { extract( $args ); extract( $instance ); $title = empty( $instance[ 'title' ] ) ? 'Tags' : $instance[ 'title' ]; echo $before_widget; if ( $title ): echo $before_title . $title . $after_title; endif; wp_tag_cloud('smallest=13&largest=13px&unit=px'); echo $after_widget; } /** * update the particular instant * * This function should check that $new_instance is set correctly. * The newly calculated value of $instance should be returned. * If "false" is returned, the instance won't be saved/updated. * * $new_instance New settings for this instance as input by the user via form() * $old_instance Old settings for this instance * Settings to save or bool false to cancel saving */ function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags($new_instance['title']); return $instance; } /** * Creates the form for the widget in the back-end which includes the Title * $instance Current settings */ function form($instance) { $instance = wp_parse_args( ( array ) $instance, array( 'title'=>'Tags' ) ); $title = esc_attr( $instance[ 'title' ] ); ?>

'widget_service', 'description' => __( 'Display Services( Business Layout )', 'attitude' ) ); $control_ops = array( 'width' => 200, 'height' =>250 ); parent::__construct( false, $name = __( 'Theme Horse: Services', 'attitude' ), $widget_ops, $control_ops); } function form( $instance ) { for ( $i=0; $i<6; $i++ ) { $var = 'page_id'.$i; $defaults[$var] = ''; } $instance = wp_parse_args( (array) $instance, $defaults ); for ( $i=0; $i<6; $i++ ) { $var = 'page_id'.$i; $var = absint( $instance[ $var ] ); } ?>

' ','name' => $this->get_field_name( key($defaults) ), 'selected' => $instance[key($defaults)] ) ); ?>

-1, 'post_type' => array( 'page' ), 'post__in' => $page_array, 'orderby' => 'post__in' ) ); echo $before_widget; ?>
have_posts() ):$get_featured_pages->the_post(); $page_title = get_the_title(); if( $j % 2 == 1 && $j > 1 ) { $service_class = "one-third clearfix-half"; } elseif ( $j % 3 == 1 && $j > 1 ) { $service_class = "one-third clearfix-third"; } else { $service_class = "one-third"; } ?>
'.get_the_post_thumbnail( $post->ID, 'icon' ).'
'; } ?>

'widget_recent_work', 'description' => __( 'Use this widget to show recent work, portfolio or any pages as your wish ( Business Layout )', 'attitude' ) ); $control_ops = array( 'width' => 200, 'height' =>250 ); parent::__construct( false, $name = __( 'Theme Horse: Featured Widget', 'attitude' ), $widget_ops, $control_ops); } function form( $instance ) { for ( $i=0; $i<4; $i++ ) { $var = 'page_id'.$i; $defaults[$var] = ''; } $att_defaults = $defaults; $att_defaults['title'] = ''; $att_defaults['text'] = ''; $instance = wp_parse_args( (array) $instance, $att_defaults ); for ( $i=0; $i<4; $i++ ) { $var = 'page_id'.$i; $var = absint( $instance[ $var ] ); } $title = esc_attr( $instance[ 'title' ] ); $text = esc_textarea($instance['text']); ?>

' ','name' => $this->get_field_name( key($defaults) ), 'selected' => $instance[key($defaults)] ) ); ?>

-1, 'post_type' => array( 'page' ), 'post__in' => $page_array, 'orderby' => 'post__in' ) ); echo $before_widget; if ( !empty( $title ) ) { echo $before_title . esc_html( $title ) . $after_title; } ?>

have_posts() ):$get_featured_pages->the_post(); $page_title = get_the_title(); ?>
'.get_the_post_thumbnail( $post->ID,'gallery').''; } ?>
'widget_testimonial', 'description' => __( 'Display Testimonial( Business Layout )', 'attitude' ) ); $control_ops = array( 'width' => 200, 'height' =>250 ); parent::__construct( false, $name = __( 'Theme Horse: Testimonial', 'attitude' ), $widget_ops, $control_ops); } function widget( $args, $instance ) { extract($args); $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $text = apply_filters( 'widget_text', empty( $instance['text'] ) ? '' : $instance['text'], $instance ); $name = apply_filters( 'widget_name', empty( $instance['name'] ) ? '' : $instance['name'], $instance, $this->id_base ); $byline = apply_filters( 'widget_byline', empty( $instance['byline'] ) ? '' : $instance['byline'], $instance, $this->id_base ); echo $before_widget; if ( !empty( $title ) ) { echo $before_title . esc_html( $title ) . $after_title; } ?>
'', 'text' => '', 'name' =>'', 'byline'=>'' ) ); $title = strip_tags($instance['title']); $name = strip_tags($instance['name']); $byline = strip_tags($instance['byline']); $text = esc_textarea($instance['text']); ?>

'widget_promotional_bar', 'description' => __('Display PromoBox ( Business Layout )', 'attitude')); $control_ops = array('width' => 200, 'height' => 250); parent::__construct(false, $name = __('Theme Horse: PromoBox', 'attitude'), $widget_ops, $control_ops); } function widget($args, $instance) { extract($args); $promotional_img_background = apply_filters( 'promotional_img_background', empty( $instance['promotional_img_background'] ) ? '' : $instance['promotional_img_background'], $instance, $this->id_base ); $widget_primary = apply_filters('widget_primary', empty($instance['widget_primary'])?'':$instance['widget_primary'], $instance, $this->id_base); $widget_secondary = apply_filters('widget_secondary', empty($instance['widget_secondary'])?'':$instance['widget_secondary'], $instance, $this->id_base); $redirect_text = apply_filters('redirect_text', empty($instance['redirect_text'])?'':$instance['redirect_text'], $instance); $widget_redirecturl = apply_filters('widget_redirecturl', empty($instance['widget_redirecturl'])?'':$instance['widget_redirecturl'], $instance, $this->id_base); echo $before_widget; ?>
style="background-image:url('');" > '.esc_html($widget_primary);}?> '; ?>
'','widget_primary' => '', 'widget_secondary' => '', 'redirect_text' => '', 'widget_redirecturl' => '')); $promotional_img_background = strip_tags($instance['promotional_img_background']); $widget_primary = esc_textarea($instance['widget_primary']); $widget_secondary = esc_textarea($instance['widget_secondary']); $redirect_text = strip_tags($instance['redirect_text']); $widget_redirecturl = esc_url($instance['widget_redirecturl']); ?>