limit characters when posting from form

To limit characters add this to your textarea: maxlength=”200″ changing “200” to whatever you want the character limit to be. <textarea id=”description” maxlength=”200″ tabindex=”3″ name=”description2″ cols=”50″ rows=”6″></textarea> For a character counter you will need some basic Javascript, something like this: counter = function() { var value = $(‘#description’).val(); if (value.length == 0) { $(‘#totalChars’).html(0); return; … Read more

CPT Post Title Permalink: Replace “@” (or all special characters) with dash “-” instead of just removing

Just make sure your filter runs before the one that WordPress itself applies – add a priority of 9: add_filter( ‘sanitize_title’, function( $title ) { if ( FALSE !== strpos( $title, ‘@’ ) ) { $title = str_replace( ‘@’, ‘-‘, $title ); } return $title; }, 9 ); Usage: echo sanitize_title( ‘[email protected]’ ); Output: mytitle-example-org

How to limit the max number of characteres in the title that are displayed

first add this function to your functions.php file function max_title_length($title){ $max = 20; return substr( $title, 0, $max ). ” &hellip;”; } then before the loop of the code you linked add this line to hook the above function: add_filter( ‘the_title’, ‘max_title_length’); and after the loop remove this filter: remove_filter( ‘the_title’, ‘max_title_length’); and just change … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)