Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to add tooltip in wordpress plugin
    primarykey
    data
    text
    <p>I am trying add additional function for myself in a wordpress plugin, but I am not understanding how can I do that, I am not so good with jQuery..</p> <p>I am trying to add tooltip but how, i don't know, can you guys please guide me.</p> <p>I added myself the following lines in the script:</p> <pre><code>wp_enqueue_script( 'jquery_ui_tooltip', CHILD_URL . '/widgets/genesis-tabs/jquery-ui.js', false, '1.9.2' ); </code></pre> <p><strong>and</strong> </p> <pre><code>wp_register_style( 'jquery_ui_styles', CHILD_URL . '/widgets/genesis-tabs/jquery-ui.css' ); wp_enqueue_style( 'jquery_ui_styles' ); </code></pre> <p>these are the codes of plugin</p> <pre><code>&lt;?php add_action( 'wp_head', 'head_slideshow', 1 ); function head_slideshow() { // javascript wp_enqueue_script( 'tabs_script', CHILD_URL . '/widgets/genesis-tabs/tabs.js', array( 'jquery' ), '1.3.2' ); wp_enqueue_script( 'jquery_ui_tooltip', CHILD_URL . '/widgets/genesis-tabs/jquery-ui.js', false, '1.9.2' ); // styles wp_register_style( 'tabs_styles', CHILD_URL . '/widgets/genesis-tabs/style.css' ); wp_register_style( 'jquery_ui_styles', CHILD_URL . '/widgets/genesis-tabs/jquery-ui.css' ); wp_enqueue_style( 'tabs_styles' ); wp_enqueue_style( 'jquery_ui_styles' ); } add_action( 'widgets_init', 'TabsWidgetRegister' ); function TabsWidgetRegister() { register_widget( 'TabsWidget' ); } class TabsWidget extends WP_Widget { function TabsWidget() { $widget_ops = array( 'classname' =&gt; 'tabs-widget', 'description' =&gt; __('Genesis - Home Featured') ); $control_ops = array( 'width' =&gt; 300, 'height' =&gt; 250, 'id_base' =&gt; 'tabs-widget' ); $this-&gt;WP_Widget( 'tabs-widget', __('Genesis - Home Featured'), $widget_ops, $control_ops ); } function widget( $args, $instance ) { extract( $args ); echo $before_widget; ?&gt; &lt;!-- .home-left --&gt; &lt;div class="carousel-slider-preview"&gt; &lt;?php $args = array ( 'post_type' =&gt; 'post', 'cat' =&gt; $instance['posts_cat'], 'showposts' =&gt; $instance['posts_num'], 'orderby' =&gt; $instance['orderby'], 'order' =&gt; $instance['order'] ); $posts_list = new WP_Query($args); $i = 1; if($posts_list-&gt;have_posts()) : while($posts_list-&gt;have_posts()) : $posts_list-&gt;the_post(); ?&gt; &lt;!-- .tab_content --&gt; &lt;div id="tab&lt;?php echo $i; ?&gt;" class="tab_content"&gt; &lt;!-- .image --&gt; &lt;div class="image"&gt; &lt;a href="#tab&lt;?php echo $i; ?&gt;"&gt;&lt;?php genesis_image("format=html&amp;size=Slider"); ?&gt;&lt;/a&gt; &lt;/div&gt; &lt;!-- .text --&gt; &lt;div&gt; &lt;?php if ( !empty( $instance['show_byline'] ) &amp;&amp; !empty( $instance['post_info'] ) ) : printf( '&lt;p class="byline post-info"&gt;%s&lt;/p&gt;', do_shortcode( esc_html( $instance['post_info'] ) ) ); endif; if(!empty($instance['show_title'])) : printf( '&lt;h2&gt;&lt;a href="%s" title="%s"&gt;%s&lt;/a&gt;&lt;/h2&gt;', get_permalink(), the_title_attribute('echo=0'), the_title_attribute('echo=0') ); endif; if(!empty($instance['show_content'])) : if($instance['show_content'] == 'excerpt') : the_excerpt(); elseif($instance['show_content'] == 'content-limit') : the_content_limit( (int)$instance['content_limit'], esc_html( $instance['more_text'] ) ); else : the_content( esc_html( $instance['more_text'] ) ); endif; endif; ?&gt; &lt;/div&gt; &lt;!-- end .home_left_content --&gt; &lt;/div&gt; &lt;!-- end .tab_content --&gt; &lt;?php $i += 1; endwhile; endif; ?&gt; &lt;/div&gt; &lt;!-- end .home-left --&gt; &lt;div class="clear"&gt;&lt;/div&gt; &lt;!-- .carousel-slider-thumbs --&gt; &lt;div class="carousel-slider-thumbs"&gt; &lt;ul class="tabs"&gt; &lt;?php $i = 1; if($posts_list-&gt;have_posts()) : while($posts_list-&gt;have_posts()) : $posts_list-&gt;the_post(); ?&gt; &lt;li&gt;&lt;a href="#tab&lt;?php echo $i; ?&gt;"&gt;&lt;?php genesis_image("format=html&amp;size=Small"); ?&gt;&lt;/a&gt;&lt;/li&gt; &lt;?php $i += 1; endwhile; endif; ?&gt; &lt;/ul&gt; &lt;/div&gt; &lt;!-- end .carousel-slider-thumbs --&gt; &lt;div class="clear"&gt;&lt;/div&gt; &lt;?php echo $after_widget; } function form( $instance ) { // ensure value exists // 'heading' =&gt; '', ( Extended by Muzammil Hussain ) $instance = wp_parse_args( (array)$instance, array( 'heading' =&gt; 'Featured Area', 'title' =&gt; '', 'show_title' =&gt; 0, 'posts_cat' =&gt; '', 'posts_num' =&gt; 0, 'orderby' =&gt; '', 'order' =&gt; '', 'show_byline' =&gt; 0, 'post_info' =&gt; '[post_date] ' . __('By', 'genesis') . ' [post_author_posts_link] [post_comments]', 'show_content' =&gt; 'excerpt', 'content_limit' =&gt; '', 'more_text' =&gt; __('[Read More...]', 'genesis') ) ); ?&gt; &lt;p&gt; &lt;label for="&lt;?php echo $this-&gt;get_field_id( 'heading' ); ?&gt;"&gt;&lt;?php _e('Title:'); ?&gt;&lt;/label&gt; &lt;input type="text" id="&lt;?php echo $this-&gt;get_field_id( 'heading' ); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name( 'heading' ); ?&gt;" value="&lt;?php echo $instance['heading']; ?&gt;" class="widefat" /&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="&lt;?php echo $this-&gt;get_field_id( 'posts_num' ); ?&gt;"&gt;&lt;?php _e('Number of Posts to Show:'); ?&gt;&lt;/label&gt; &lt;input class="widefat" type="text" id="&lt;?php echo $this-&gt;get_field_id( 'posts_num' ); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name( 'posts_num' ); ?&gt;" value="&lt;?php echo $instance['posts_num']; ?&gt;" style="width:30px;" /&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="&lt;?php echo $this-&gt;get_field_id('orderby'); ?&gt;"&gt;&lt;?php _e('Order By'); ?&gt;:&lt;/label&gt; &lt;select class="widefat" id="&lt;?php echo $this-&gt;get_field_id('orderby'); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name('orderby'); ?&gt;"&gt; &lt;option style="padding-right:10px;" value="date" &lt;?php selected('date', $instance['orderby']); ?&gt;&gt;&lt;?php _e('Date'); ?&gt;&lt;/option&gt; &lt;option style="padding-right:10px;" value="title" &lt;?php selected('title', $instance['orderby']); ?&gt;&gt;&lt;?php _e('Title'); ?&gt;&lt;/option&gt; &lt;option style="padding-right:10px;" value="parent" &lt;?php selected('parent', $instance['orderby']); ?&gt;&gt;&lt;?php _e('Parent'); ?&gt;&lt;/option&gt; &lt;option style="padding-right:10px;" value="ID" &lt;?php selected('ID', $instance['orderby']); ?&gt;&gt;&lt;?php _e('ID'); ?&gt;&lt;/option&gt; &lt;option style="padding-right:10px;" value="comment_count" &lt;?php selected('comment_count', $instance['orderby']); ?&gt;&gt;&lt;?php _e('Comment Count'); ?&gt;&lt;/option&gt; &lt;option style="padding-right:10px;" value="rand" &lt;?php selected('rand', $instance['orderby']); ?&gt;&gt;&lt;?php _e('Random'); ?&gt;&lt;/option&gt; &lt;/select&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="&lt;?php echo $this-&gt;get_field_id('order'); ?&gt;"&gt;&lt;?php _e('Sort Order'); ?&gt;:&lt;/label&gt; &lt;select class="widefat" id="&lt;?php echo $this-&gt;get_field_id('order'); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name('order'); ?&gt;"&gt; &lt;option style="padding-right:10px;" value="DESC" &lt;?php selected('DESC', $instance['order']); ?&gt;&gt;&lt;?php _e('Descending (3, 2, 1)'); ?&gt;&lt;/option&gt; &lt;option style="padding-right:10px;" value="ASC" &lt;?php selected('ASC', $instance['order']); ?&gt;&gt;&lt;?php _e('Ascending (1, 2, 3)'); ?&gt;&lt;/option&gt; &lt;/select&gt; &lt;/p&gt; &lt;p&gt; &lt;input class="checkbox" id="&lt;?php echo $this-&gt;get_field_id('show_title'); ?&gt;" type="checkbox" name="&lt;?php echo $this-&gt;get_field_name('show_title'); ?&gt;" value="1" &lt;?php checked(1, $instance['show_title']); ?&gt;/&gt; &lt;label for="&lt;?php echo $this-&gt;get_field_id('show_title'); ?&gt;"&gt;&lt;?php _e('Show Post Title', 'genesis'); ?&gt;&lt;/label&gt; &lt;br&gt; &lt;input class="checkbox" id="&lt;?php echo $this-&gt;get_field_id('show_byline'); ?&gt;" type="checkbox" name="&lt;?php echo $this-&gt;get_field_name('show_byline'); ?&gt;" value="1" &lt;?php checked(1, $instance['show_byline']); ?&gt;/&gt; &lt;label for="&lt;?php echo $this-&gt;get_field_id('show_byline'); ?&gt;"&gt;&lt;?php _e('Show Post Byline'); ?&gt;&lt;/label&gt; &lt;/p&gt; &lt;p&gt; &lt;input type="text" id="&lt;?php echo $this-&gt;get_field_id('post_info'); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name('post_info'); ?&gt;" value="&lt;?php echo esc_attr($instance['post_info']); ?&gt;" style="width: 99%;" /&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="&lt;?php echo $this-&gt;get_field_id( 'posts_cat' ); ?&gt;"&gt;&lt;?php _e('Category:'); ?&gt;&lt;/label&gt; &lt;?php wp_dropdown_categories(array('name' =&gt; $this-&gt;get_field_name('posts_cat'), 'selected' =&gt; $instance['posts_cat'], 'orderby' =&gt; 'Name' , 'hierarchical' =&gt; 1, 'show_option_all' =&gt; __("All Categories"), 'hide_empty' =&gt; '0')); ?&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="&lt;?php echo $this-&gt;get_field_id('show_content'); ?&gt;"&gt;&lt;?php _e('Content Type', 'genesis'); ?&gt;:&lt;/label&gt; &lt;select class="widefat" id="&lt;?php echo $this-&gt;get_field_id('show_content'); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name('show_content'); ?&gt;"&gt; &lt;option value="content" &lt;?php selected('content' , $instance['show_content'] ); ?&gt;&gt;&lt;?php _e('Show Content', 'genesis'); ?&gt;&lt;/option&gt; &lt;option value="excerpt" &lt;?php selected('excerpt' , $instance['show_content'] ); ?&gt;&gt;&lt;?php _e('Show Excerpt', 'genesis'); ?&gt;&lt;/option&gt; &lt;option value="content-limit" &lt;?php selected('content-limit' , $instance['show_content'] ); ?&gt;&gt;&lt;?php _e('Show Content Limit', 'genesis'); ?&gt;&lt;/option&gt; &lt;option value="" &lt;?php selected('' , $instance['show_content'] ); ?&gt;&gt;&lt;?php _e('No Content', 'genesis'); ?&gt;&lt;/option&gt; &lt;/select&gt; &lt;br /&gt; &lt;br /&gt; &lt;label for="&lt;?php echo $this-&gt;get_field_id('content_limit'); ?&gt;"&gt;&lt;?php _e('Limit content to', 'genesis'); ?&gt;&lt;/label&gt; &lt;input class="widefat" type="text" id="&lt;?php echo $this-&gt;get_field_id('image_alignment'); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name('content_limit'); ?&gt;" value="&lt;?php echo esc_attr(intval($instance['content_limit'])); ?&gt;" size="3" /&gt; &lt;?php _e('characters', 'genesis'); ?&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="&lt;?php echo $this-&gt;get_field_id('more_text'); ?&gt;"&gt;&lt;?php _e('More Text (if applicable)', 'genesis'); ?&gt;:&lt;/label&gt; &lt;input class="widefat" type="text" id="&lt;?php echo $this-&gt;get_field_id('more_text'); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name('more_text'); ?&gt;" value="&lt;?php echo esc_attr($instance['more_text']); ?&gt;" /&gt; &lt;/p&gt; &lt;?php } } ?&gt; </code></pre> <p>and its jQuery file is:</p> <pre><code>var $jq=jQuery.noConflict(); $jq(document).ready(function(){ $jq(".tab_content").hide(); $jq("ul.tabs li:first").addClass("active").show(); $jq(".tab_content:first").show(); $jq("ul.tabs li").click(function(){ $jq("ul.tabs li").removeClass("active"); $jq(this).addClass("active"); $jq(".tab_content").hide(); var activeTab = $jq(this).find("a").attr("href"); $jq(activeTab).fadeIn(); return false }) }); </code></pre> <p>I am trying to show the description of each image in tooltip when someone mouse over the tab small images,,</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload