rookie mistake isset($_POST
*facepalm* $_POST is always set, it can only be empty.
*facepalm* $_POST is always set, it can only be empty.
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())…
Queries are only available after “wp” action hook, so ‘init’ is too early to check for it.
is_numeric doesnt check strings for numbers. You need to use preg_match(‘#[0-9]#’,$string)
Always check for local time Despite the fact that my server timezone was set correctly, somehow time() was giving wrong ( UTC) hour. So i ended up using wp’s functions to make sure. $now = current_time( ‘timestamp’, 0 ) ;$local_ts = get_the_time(‘U’,$post->ID);
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…
Actually, you do not want to open memcached port in your firewall. #ref: http://serverfault.com/questions/530051/memcached-ports-and-csf