How do i use this jquery script on a wordpress site?

Its pretty simple. First you have to add a function in your themes funcition.php file to register and enqueue your scripts in head using wp_enqueue_scripts hook. // Register and enqueue all scripts in head function custom_scripts() { wp_register_script( ‘script_googleapis’, ‘http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js’, false, false, false ); wp_enqueue_script( ‘script_googleapis’ ); wp_register_script( ‘script_listjs’, ‘http://listjs.com/no-cdn/list.js’, false, false, false ); wp_enqueue_script( … Read more

window.send_to_editor and jQuery .attr() conflicts with multiple custom upload image meta boxes

I did similar thing recently but used the wp.media instead of ThickBox https://codex.wordpress.org/Javascript_Reference/wp.media with the same code from Codex. The only thing to make it work with multiple inputs is to move the frame variable from global scope to click function, so the ‘frame’ will be fresh for each click.

Creating multiple enclosing shortcodes and fixing JS issues on click

Code:- function more_shortcode( $atts , $content = null ){ return ‘<div id=”more-outer-‘.$atts[‘id’].'”><a href=”#” id=”more-link-‘.$atts[‘id’].'”>More</a><div id=”more-inner”>’. $content .'</div></div>’; } add_shortcode( ‘more’, ‘more_shortcode’ ); Usage:- [more id=’1′]This is one.[/more] [more id=’2′]This is two.[/more] [more id=’3′]This is three.[/more] Output:- <div id=”more-outer-1″><a href=”#” id=”more-link-1″>More</a><div id=”more-inner”>This is one.</div></div> <div id=”more-outer-2″><a href=”#” id=”more-link-2″>More</a><div id=”more-inner”>This is two.</div></div> <div id=”more-outer-3″><a href=”#” id=”more-link-3″>More</a><div id=”more-inner”>This … Read more

Add a row on clicking each post featured image

If you go with @Rituparna’s solution, try this: Don’t forget to add <a href=”#” class=”close”>X</a> in your container. jQuery(function($){ $(“.plink”).on(‘click’, function( event ){ event.preventDefault(); // cache the link clicked on var link = $(event.target); // use the link attr to target the desc var containerID = link.attr(‘href’); // get the description contained in the link … Read more

Show post in slider

I used this to show images on slider .Try this <div class=”col-md-12″> <div class=”carousel carousel-showmanymoveone slide” id=”carousel123″> <div class=”carousel-inner”> <div class=”item active”> <div class=”col-xs-12 col-sm-6 col-md-3″> <img src=”https://wordpress.stackexchange.com/questions/217614/<?php echo plugin_dir_url( __FILE__ ) .”img/download-1.jpg’; ?>”></div> </div> <div class=”item”> <div class=”col-xs-12 col-sm-6 col-md-3″> <img src=”https://wordpress.stackexchange.com/questions/217614/<?php echo plugin_dir_url( __FILE__ ) .”img/download-1.jpg’; ?>”></div> </div> <div class=”item”> <div class=”col-xs-12 col-sm-6 … Read more