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 ). ” …”; } 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

How to limit get_posts()?

You can use posts_per_page or numberposts. http://codex.wordpress.org/Template_Tags/get_posts#Parameters EDIT: Regarding your edit. You cannot have the posts_per_page different to the LIMIT in the SQL query. get_posts() creates an instance of WP_Query and returns it using the posts_per_page as the LIMIT.

How to get max upload size and accepted file types on multisite?

Yes, you can easily grab those multisite values from database using an MU (μ) Function: get_site_option() Getting Fields Maximum Upload Size The maximum upload size, per site (NOT per blog), per file can be found using: $max_up = get_site_option(‘fileupload_maxk’); var_dump($max_up); //in kilobytes Accepted File Types The accepted file types per site (NOT per blog) can … Read more

Limit the_excerpt with max of x characters

add_filter(‘wp_trim_excerpt’, function($text){ $max_length = 140; if(mb_strlen($text, ‘UTF-8’) > $max_length){ $split_pos = mb_strpos(wordwrap($text, $max_length), “\n”, 0, ‘UTF-8’); $text = mb_substr($text, 0, $split_pos, ‘UTF-8′); } return $text; }); This should take into account your max length and split the text at the nearest word boundary. Apply the filter, and call the_excerpt(); in your templates Apparently there’s a … Read more

Limit the Excerpt field in WP-Admin in words

You can use something like jQuery Simply Countable plugin and attach it to excerpt input. Limit_Excerpt_Words::on_load(); class Limit_Excerpt_Words { static function on_load() { add_action( ‘admin_enqueue_scripts’, array( __CLASS__, ‘admin_enqueue_scripts’ ) ); } static function admin_enqueue_scripts() { global $hook_suffix; if ( ‘post.php’ == $hook_suffix || ‘post-new.php’ == $hook_suffix ) { wp_enqueue_script( ‘jquery-simply-countable’, plugins_url( ‘/jquery.simplyCountable.js’, __FILE__ ), array( … Read more

Images Missing from built in WP Gallery

You have a limit inside an script and you should change some values to adapt your needs: jQuery…. //user settings var thumbsPerPage = 15; var maxPaginatedLinks = 200; var hideEffect = “drop”; var showEffect = “drop”; var effectSpeed = “slow”; var count = 1; //handles multiple galleries on page var galleryCount = $( “[id^=gallery-]” ).each( … Read more

Restrict access to post if it is currently being edited

The warning notice gets dispatched by the function wp_check_post_lock. The following redirects the user back to the post listing screen if someone else is editing it. add_action( ‘load-post.php’, ‘redirect_locked_post_wpse_95718’ ); function redirect_locked_post_wpse_95718() { if( isset($_GET[‘post’] ) && wp_check_post_lock( $_GET[‘post’] ) ) { global $typenow; $goto = ( ‘post’ == $typenow ) ? ” : “?post_type=$typenow”; … Read more

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