Check if WP User ID is not one of these
How to do if statements with an array? Learn how to check whether or not certain user ids are included.
1 2 3 |
if ( !in_array($user->ID, [86,89]) ) { // if this then do... } |
How to do if statements with an array? Learn how to check whether or not certain user ids are included.
1 2 3 |
if ( !in_array($user->ID, [86,89]) ) { // if this then do... } |
If you use Bower as your front end package manager, you may need to install something that’s not in the Bower package library. But chances are it’s on Github. That’s awesome for this case! Bower can manage Github repos using … Continued
I’ve updated these instructions to handle some issues syncing NPM with Sage on Ubuntu 14. Sage has become one of the preferred starter themes used by an industry leading WordPress development company. I don’t know how long these specific instructions will work for, but right now … Continued
How to verify a CNAME record Why would you need to verify a CNAME record? This is useful if your domain name was registered with a service, but you don’t have access to the account and would like to create … Continued
Keep all of your web application’s front end libraries/dependencies up to date with Bower package manager. This intro shows you how to install the bower command-line utility and learn about the various commands necessary for managing your front end packages. Installing Bower … Continued
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
@media (max-width: 992px) { .navbar-header { float: none; } .navbar-left,.navbar-right { float: none !important; } .navbar-toggle { display: block; } .navbar-collapse { border-top: 1px solid transparent; box-shadow: inset 0 1px 0 rgba(255,255,255,0.1); } .navbar-fixed-top { top: 0; border-width: 0 0 1px; } .navbar-collapse.collapse { display: none!important; } .navbar-nav { float: none!important; margin-top: 7.5px; } .navbar-nav>li { float: none; } .navbar-nav>li>a { padding-top: 10px; padding-bottom: 10px; } .collapse.in{ display:block !important; } } |
For this tutorial we’ll be adding the Flickity JS plugin to the Sage WordPress starter theme using Bower as our dependency manager. Flickity is a great JS plugin for developing responsive touch enabled image sliders and galleries. You only need … Continued
Remove access to the wp dashboard for users roles lower than a certain level. For example, users that are subscribers (not administrator or editors), would be disabled from accessing and would be redirected back to the homepage upon trying to … Continued
Create on scroll animation effects on your website using waypoints and animate.css. Waypoints allows developers to execute a function when an element is scrolled to, in this case, we will execute an animation. Animate.css is a library of CSS animations … Continued
Change WP’s default “post” type menu and overall labels to anything you want, by replacing every instance of “post” using the code below with your desired label. Post this code in your theme’s functions.php file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
function revcon_change_post_label() { global $menu; global $submenu; $menu[5][0] = 'News'; $submenu['edit.php'][5][0] = 'News'; $submenu['edit.php'][10][0] = 'Add News'; $submenu['edit.php'][16][0] = 'News Tags'; echo ''; } function revcon_change_post_object() { global $wp_post_types; $labels = &$wp_post_types['post']->labels; $labels->name = 'News'; $labels->singular_name = 'News'; $labels->add_new = 'Add News'; $labels->add_new_item = 'Add News'; $labels->edit_item = 'Edit News'; $labels->new_item = 'News'; $labels->view_item = 'View News'; $labels->search_items = 'Search News'; $labels->not_found = 'No News found'; $labels->not_found_in_trash = 'No News found in Trash'; $labels->all_items = 'All News'; $labels->menu_name = 'News'; $labels->name_admin_bar = 'News'; } add_action( 'admin_menu', 'revcon_change_post_label' ); add_action( 'init', 'revcon_change_post_object' ); |
Reference URL