WordPress.org

Forums

Request a Quote widget (1 post)

  1. censura
    Member
    Posted 3 years ago #

    Hi Guys hope you are all well, I purchased a word press template and in the process of modifing it.

    On the home page there is a widget - Request a quote. (you can view the site at isgquickpay.com - work in progress so bare with me)

    It is about half way down the page there are thre blocks of text heade Self Employed Service , Company Payroll Services and SME payroll Cash Flow. You can see below this are 3 icons that don't do a lot but ifeel they ought to. Ideally i expected them to be able to be clicked and bring up a Get a quote form (seemed logical to me from the widget name) but in the right hand settings for the widget there is no such options. I have looked into the php code (I am not a programmer, done a little HTML) but I can't see where to set this up if it is there in the code already

    If someone can help that would be great

    code below

    <?php
    // =============================== My Request Quote Widget ======================================
    class MY_RequestQuoteWidget extends WP_Widget {
        /** constructor */
        function MY_RequestQuoteWidget() {
            parent::WP_Widget(false, $name = 'My - Request a Quote');
        }
    
        /** @see WP_Widget::widget */
        function widget($args, $instance) {
            extract( $args );
            $title = apply_filters('widget_title', $instance['title']);
    	$desc = apply_filters('widget_desc', $instance['desc']);
    				$txt1 = apply_filters('widget_txt1', $instance['txt1']);
    				$txt2 = apply_filters('widget_txt2', $instance['txt2']);
    				$txt3 = apply_filters('widget_txt3', $instance['txt3']);
    				$style = apply_filters('widget_style', $instance['style']);
            ?>
    
    		<?php
    			if($txt2=="" && $txt3==""){
    				$class='w-full';
    			} else {}
    		?>
                  <?php echo $before_widget; ?>
    			  			<div class="top-box maxheight <?php if ($style!="") {echo $style;} ?>">
    							<div class="top-bg">
    							    <?php if($title!=""){ ?>
    							    <div class="box-text <?php echo $class; ?>">
    								    <h2><?php echo $title; ?></h2>
    								    <?php if ($desc!='') { ?>
    									<small class="desc"><?php echo $desc; ?></small>
    								    <?php } ?>
    								    <figure class="icon-wrap"><span class="icon"></span></figure>
    								    <div><?php echo $txt1; ?></div>
    							    </div><!-- end 'with title' -->
    							    <?php } else { ?>
    							    <div class="box-text <?php echo $class; ?>">
    								    <?php echo $txt1; ?>
    							    </div><!-- end 'without title' -->
    							    <?php } ?>
    
    							    <?php if($txt2!="" && $txt3!=""){ ?>
    								    <div class="box-button">
    									    <a href="<?php echo $txt3; ?>" class="link"><?php echo $txt2; ?></a>
    								    </div><!-- end 'button' -->
    							    <?php } ?>
    							</div>
    						</div>
                  <?php echo $after_widget; ?>
            <?php
        }
    
        /** @see WP_Widget::update */
        function update($new_instance, $old_instance) {
            return $new_instance;
        }
    
        /** @see WP_Widget::form */
        function form($instance) {
            $title = esc_attr($instance['title']);
    	$desc = esc_attr($instance['desc']);
    				$txt1 = esc_attr($instance['txt1']);
    				$txt2 = esc_attr($instance['txt2']);
    				$txt3 = esc_attr($instance['txt3']);
    				$style = esc_attr($instance['style']);
            ?>
           <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'theme1594'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></label></p>
    
           <p><label for="<?php echo $this->get_field_id('desc'); ?>"><?php _e('Description:', 'theme1594'); ?> <input class="widefat" id="<?php echo $this->get_field_id('desc'); ?>" name="<?php echo $this->get_field_name('desc'); ?>" type="text" value="<?php echo $desc; ?>" /></label></p>
    
           <p><label for="<?php echo $this->get_field_id('icon'); ?>"><?php _e('Style:', 'theme1413'); ?><br />
    
            <select id="<?php echo $this->get_field_id('style'); ?>" name="<?php echo $this->get_field_name('style'); ?>" style="width:150px;" >
            <option value="style1" <?php echo ($style === 'style1' ? ' selected="selected"' : ''); ?>>style1</option>
            <option value="style2" <?php echo ($style === 'style2' ? ' selected="selected"' : ''); ?> >style2</option>
            <option value="style3" <?php echo ($style === 'style3' ? ' selected="selected"' : ''); ?> >style3</option>
            </select>
            </label></p>
    
    			 <p><label for="<?php echo $this->get_field_id('txt1'); ?>"><?php _e('Text:', 'theme1594'); ?><textarea rows="5"  class="widefat" id="<?php echo $this->get_field_id('txt1'); ?>" name="<?php echo $this->get_field_name('txt1'); ?>"><?php echo $txt1; ?></textarea></label></p>
    			 <p><label for="<?php echo $this->get_field_id('txt2'); ?>"><?php _e('Button Text:', 'theme1594'); ?> <input class="widefat" id="<?php echo $this->get_field_id('txt2'); ?>" name="<?php echo $this->get_field_name('txt2'); ?>" type="text" value="<?php echo $txt2; ?>" /></label></p>
    			 <p><label for="<?php echo $this->get_field_id('txt3'); ?>"><?php _e('Button URL:', 'theme1594'); ?> <input class="widefat" id="<?php echo $this->get_field_id('txt3'); ?>" name="<?php echo $this->get_field_name('txt3'); ?>" type="text" value="<?php echo $txt3; ?>" /></label></p>
            <?php
        }
    
    } // class Request Quote Widget
    
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic