Truncating varying lengths of information

I know toscho doesn’t like this very much, but anyway: Converted the input args to an array: function utf8_truncate( $args = array( ‘string’ => null, ‘max_chars’ => 200, ‘append’ => “\xC2\xA0…” ) ) { $args[‘string’] = strip_tags( $args[‘string’] ); $args[‘string’] = html_entity_decode( $args[‘string’], ENT_QUOTES, ‘utf-8’ ); // \xC2\xA0 is the no-break space $args[‘string’] = trim( … Read more

register_post_type name character limit

You cannot change that value. The database schema is limited to 20 Bytes. See wp-admin/includes/schema.php: TABLE $wpdb->posts ( ID bigint(20) unsigned NOT NULL auto_increment, post_author bigint(20) unsigned NOT NULL default ‘0’, post_date datetime NOT NULL default ‘0000-00-00 00:00:00’, post_date_gmt datetime NOT NULL default ‘0000-00-00 00:00:00’, post_content longtext NOT NULL, post_title text NOT NULL, post_excerpt text … Read more

RewriteRule accepts numbers but not letters in tag

Leave .htaccess alone. You can use WordPress rewrite API for this. add_action( ‘init’, function(){ return add_rewrite_rule( ‘subdir/([^/]+)/?$’, // ([^/]+) takes alphanumeric, while ([0-9]+) accepts digits ‘index.php?pagename=subdir&website=$matches[1]’, ‘top’ ); }); add_filter(‘query_vars’, function($v){ return array_merge(array(‘website’),$v); }); First make sure subdir is a valid page slug, in this example. After you save that code to your child theme’s … Read more

Hebrew Characters Have gone bad

I’m totally shocked. After hours of trying things and testing, I finally found the “Settings” then “Readings” option below: “Encoding for pages and feeds”. After changing from UTF-7 to UTF-8, everything looks good again. And even stranger, after changing it to UTF-8, the option disappears from the page. According to WordPress site, this option was … Read more

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