Blog Archives

Smooth Scroll Page When Clicking Anchor Link – jQuery

Add this to your jQuery file. // Smooth scroll When Clicking Anchor // @refer https://stackoverflow.com/a/7717572/8255629 var jQueryroot = $(‘html, body’); $(‘a[href^="#"]’).click(function () {   jQueryroot.animate({     scrollTop: $( $.attr(this, ‘href’) ).offset().top   }, 1000);   return false; });

Posted in WordPress Tagged with: , ,

Sanitize And Escape Text Input In WordPress

For general sanitization of text input fields and text areas for plugin options and such, use: sanitize_text_field( string $string ) For escaping in general for text input fields, use: esc_attr( string $string ) @refer https://wordpress.stackexchange.com/a/66323/90061

Posted in WordPress Tagged with: ,

Get Raw Unfiltered Post Title In WordPress

To retrieve the post title of a post as saved in the wp_posts table in the WordPress database use this <?php echo get_post_field( ‘post_title’, $post_id, ‘raw’ ); ?> If you use get_the_title() function, WordPress applies the ‘the_title‘ filter before returning

Posted in WordPress Tagged with: ,

Find All Posts Containing Given Image In WordPress

Pass the id of the image to the function and it will return an array with the id’s of all the posts that use the given image. /** * Find all posts that uses the given image * * @param  $image_id  Integer    ID

Posted in WordPress Tagged with: , ,

Building 100% Custom WordPress Register And Login Pages

A detailed tutorial on how to build totally custom WordPress register and login pages. All the code you need and some styling inspiration. Impress your clients.

Posted in Tutorials, WordPress Tagged with: , , , ,