Disable New Line in Textarea when Pressed ENTER

Disable New Line in Textarea when Pressed ENTER Disable New Line in Textarea when Pressed ENTER <script> $(document).ready(function(){ $(“textarea”).keydown(function(e){ if (e.keyCode == 13 && !e.shiftKey) { // prevent default behavior e.preventDefault(); //alert(“ok”); return false; } }); }); </script> READ MORE ARTICLES. Blogspot Articles

How to convert url to embed code from youtube and vimeo url dynamically?

How to convert url to embed code from youtube and vimeo url dynamically. Some video projects includes google api need to embed Youtube video url dynamically. Here is the solution for extracting the unique id from url and convert them to embed form. Follow the step wise step: Step 1. First get the video id […]

How to index html table rows? or how to Auto-number table rows?

How to index html table rows or how to Auto-number table rows? CSS: Method 1 table {     counter-reset: rowNumber; } table tr {     counter-increment: rowNumber; } table tr td:first-child::before {     content: counter(rowNumber);     min-width: 1em;     margin-right: 0.5em; } JS: Method 2 (append with a new td) […]

MailChimp API and PHP Script to Add Subscriber in List Campaign

MailChimp API and Php Script MailChimp is an email marketing service, helps to manage the subscribers of your website. MailChimp provides an easy way to integrate email signup form in your website and send the email newsletter to the subscriber. Beside the premium plan MailChimp also has a forever free plan. Using the free plan, […]

How to build a WordPress Post Pagination without plugin?

The function Paste this function code in your theme functions.php file: if ( ! function_exists( ‘post_pagination’ ) ) : function post_pagination() { global $wp_query; $pager = 999999999; // need an unlikely integer echo paginate_links( array( ‘base’ => str_replace( $pager, ‘%#%’, esc_url( get_pagenum_link( $pager ) ) ), ‘format’ => ‘?paged=%#%’, ‘current’ => max( 1, get_query_var(‘paged’) ), […]

How to add menu page with different name for first submenu item in wordpress?

You can make the ‘slug’ for the submenu page equal that of the top level page, and they’ll point to the same place: add_action(‘admin_menu’, ‘my_menu_pages’); function my_menu_pages(){ add_menu_page(‘My Page Title’, ‘My Menu Title’, ‘manage_options’, ‘my-menu’, ‘my_menu_output’ ); add_submenu_page(‘my-menu’, ‘Submenu Page Title’, ‘Whatever You Want’, ‘manage_options’, ‘my-menu’ ); add_submenu_page(‘my-menu’, ‘Submenu Page Title2’, ‘Whatever You Want2’, ‘manage_options’, […]

How to create custom widgets in WordPress?

Creating a Custom Widget in WordPress You can also paste the below code in your theme’s functions.php file. However, it will only be available when that particular theme is active. // Register and load the widget function wpb_load_widget() { register_widget( ‘wpb_widget’ ); } add_action( ‘widgets_init’, ‘wpb_load_widget’ ); // Creating the widget class wpb_widget extends WP_Widget […]

How to remove srcset in wordpress : Logo Problem | Images Problem

// Clean the up the image from wp_get_attachment_image() add_filter( ‘wp_get_attachment_image_attributes’, function( $attr ) { if( isset( $attr[‘sizes’] ) ) unset( $attr[‘sizes’] ); if( isset( $attr[‘srcset’] ) ) unset( $attr[‘srcset’] ); return $attr; }, PHP_INT_MAX ); // Override the calculated image sizes add_filter( ‘wp_calculate_image_sizes’, ‘__return_empty_array’, PHP_INT_MAX ); // Override the calculated image sources add_filter( ‘wp_calculate_image_srcset’, ‘__return_empty_array’, […]

How do I disable responsive images in WP 4.4?

// Clean the up the image from wp_get_attachment_image() add_filter( ‘wp_get_attachment_image_attributes’, function( $attr ) { if( isset( $attr[‘sizes’] ) ) unset( $attr[‘sizes’] ); if( isset( $attr[‘srcset’] ) ) unset( $attr[‘srcset’] ); return $attr; }, PHP_INT_MAX ); // Override the calculated image sizes add_filter( ‘wp_calculate_image_sizes’, ‘__return_empty_array’, PHP_INT_MAX ); // Override the calculated image sources add_filter( ‘wp_calculate_image_srcset’, ‘__return_empty_array’, […]

Bitnami