Problems with multibyte characters
There are mb_strlen() and mb_substr() for multibyte characters however there is no mb_str_word_count. Hence my previous post.
There are mb_strlen() and mb_substr() for multibyte characters however there is no mb_str_word_count. Hence my previous post.
SELECT CONCAT(‘ALTER TABLE `’, TABLE_NAME,’` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;’) AS mySQL FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA= “myschema” AND TABLE_TYPE=”BASE TABLE” Change “myschema” to your db_name , phpmyadmin will print out the commands you need to run… If any of them are trimmed with a “…” click “print view” select all commands and run.
I needed a placeholder for tags input but it’s boring to display the same tags every time. But unlike posts, WP doesnt have “rand” orderby paramater. So what you can do; is to get a #no of tags and shuffle them. So basically what we do is: Check if we have a recent transient If…
My navigation menu started disappearing on category pages. First I suspected there was something with the header or menu location, I have double, triple checked everything and I was pulling my hair out trying to find a solution. Turns out, my attempt to order posts by a custom field interfered with the menu. if( ! $query->is_main_query())…
When your content area is smallar then your offcanvas menu you’ll get double-rainbowed. To prevent this simply remove either body | html from the following rule in offcanvas.css /* * Style tweaks * ————————————————– */ html, body { overflow-x: hidden; /* Prevent scroll on narrow devices */ } so that it reads: body { overflow-x:…
View the code on Gist.
If you are using “page-template”s you’ll have problems with pagination since pages are not meant to display posts and some people frown upon using page-templates for custom archive display, but it’s sometimes the simplest way. Anyway the solution is 1.) to nullify the global $wpquery 2.) adding ‘paged’ => $paged arg. before displaying your posts…