Showing all posts (5)

How to hide menu items from wordpress admin for your clients

January 29, 2019

Just use the Adminimize plugin! If you don’t wanna, here are some functions function remove_menus(){ if (!current_user_can(‘administrator’)) { remove_menu_page( ‘index.php’ ); remove_menu_page( ‘upload.php’ ); remove_menu_page( ‘vc-welcome’ ); remove_menu_page( ‘tools.php’ ); remove_menu_page( ‘edit.php?post_type=vacancy’ ); remove_menu_page( ‘edit.php?post_type=branch’ ); remove_menu_page( ‘edit.php?post_type=person’ ); remove_menu_page( ‘edit.php?post_type=page’ ); remove_menu_page( ‘peak6-general-settings’ ); } } add_action( ‘admin_menu’, ‘remove_menus’, 20 ); add_action( ‘admin_bar_menu’, ‘remove_wp_logo’, … Read More

How to create dynamically populated cascading dropdown-lists for Contact Form 7

December 29, 2017

Something I had to deal with quite often lately, is creating dynamic drop-down lists in WordPress, like this: As always, I like to use the WordPress plugin Contact Form 7 as a basis for all my form-driven projects. The reason is that Contact Form 7 has a robust validation mechanism. It is very lightweight, yet powerful … Read More

WordPress Filterable Admin Columns for Custom Posts

October 17, 2017

After reading the great article on Ractoon.com on how to create sortable admin columns for custom posts, I decided I wanted to take things a step further and add a select box to the top of the posts table to filter by a custom field. Here’s the code. I followed the same naming conventions as … Read More

HTML5 alternative for nested anchor tags

October 16, 2017

HTML 5 standards do not allow nesting of hyperlinks, although there are some valid use cases to allow this. So we need to rely on a work-around like this one for now: HTML <div class=”block”> <a class=”overlay” href=”#overlay-link”></a> <div class=”inner”> This entire box is a hyperlink. (Kind of)<br><br><br><br> <a href=”#inner-link”>I’m a W3C compliant hyperlink inside … Read More

Apache very slow on localhost on Windows 10

November 25, 2015

Apache was slow, and then I disabled XDebug in PHP.ini, and then apache was fast again. The end. … Read More