Script not working in post content

Put this markup where you would like to before footer. you can put this markup in page editor text mode too. But doing so will remain in that page alone. so place it in template files. Search: <input type=”text” id=”fname” > <a id=”sear” href=”” target=”_blank”>Search</a> write a function and hook it to wp_footer, place the … Read more

How to blur the_post_thumbnail() via blur.js (jquery)?

I figured it out. blur.js needs an background-image to work. i had to set the image as background separately: <?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), ‘full’ );?> <a href=”https://wordpress.stackexchange.com/questions/210956/<?php echo $imageLink; ?>”> <div class=”testbg” style=”background-image: url(‘<?php echo $thumb[‘0′];?>’)”> <?php the_post_thumbnail(); ?> </div> </a>

Masonry – Can’t Find Variable imagesLoaded

I discovered that by removing the footer.php file, I was removing a link to the function wp_footer(); which essentially does this: function wp_footer() { /** * Print scripts or data before the closing body tag on the front end. * * @since 1.5.1 */ do_action( ‘wp_footer’ ); }

JavaScript and Google PageSpeed + wp_enqueue_script

You can copy this code to a JS file then enqueue that to wordpress . For Ex : Copy codes to scripts.js in js folder , then in functions.php write : function enqueue_scripts() { wp_register_script(‘scripts’, get_template_directory_uri(). ‘/js/scripts.js’,”, ”, true); wp_enqueue_script(‘scripts’); } add_action( ‘wp_enqueue_scripts’,’enqueue_scripts’ );

Meta Box – Javascript Datatable

Refer to Creating a new PostBox in WordPress. As long as you name the fields the same in render as you do in save then you’re good. RENDER echo ‘<input type=”text” id=”boxpost_meta_field” name=”boxpost_meta_field”‘; SAVE $mydata = sanitize_text_field( $_POST[‘boxpost_meta_field’] ); // Update the meta field. update_post_meta( $post_id, ‘_boxpost_meta_field_value_key’, $mydata ); GET $value = get_post_meta( $post->ID, ‘_boxpost_meta_field_value_key’, … Read more