no more WPLANG in wp-config
as of 4.0, WP doesnt use
define('WPLANG', 'en_GB');
in wp-config but uses
$locale='fr_FR';
If you want to add name email or any additional fields in addition to password for protected posts, see the steps below: /****************** custom protected post form *****/ add_filter( ‘the_password_form’, ‘custom_password_form’ ); function custom_password_form() { global $post; $label = ‘pwbox-‘.( empty( $post->ID ) ? rand() : $post->ID ); $a = ‘<div class=”clearfix”><form id=”password_form” class=”protected-post-form” action=”‘…
I was working on an autocomplete solution and I was thinking of ways to speed up the search. I will be providing a few examples with results below. Q1 is the default wordpress search with no parameters. Q2 removes the caches since they wont be really necessary. And Q3 is tailored for precision; ie: my…
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…
There are various ways to get user_ID in WP. But which one is the fastest ? I’ve compared 3 ways function get_uid_from_global() { global $current_user; return $current_user->ID; } function get_uid_by_gcuid() { return get_current_user_id(); } function get_uid_by_wpgcu_id() { return wp_get_current_user()->ID; } Without a doubt, global method was fastest. With multiple 100,000 runs, global method took 0.9~…
Long story short: BAD IDEA, don’t. It’s widely recommended to edit some of the spam comments -removing the spam url and editing comment content to something more related- and approving them in order to gain you some SEO advantage.It’s supposed to give you SEO advantage if your article has more comments (You could fake it…
If you are familiar with WordPress, you should already know that you should almost never have to use get_posts(). Your best bet is to use WP_Query . As good as wp_query is, you should still fine-tune it depending on your needs, it does make a difference. For example, if you just need 1 random post…