Install WP-CLI

The wp-cli command-line utility allows you to manage your WordPress sites without going through the WordPress dashboard, much like Drush does for Drupal. To install Composer and wp-cli on Ubuntu 16.04: Install Composer (I’d recommend not doing this as root.) Install wp-cli This installs wp-cli to $HOME/.config/composer/vendor/wp-cli/wp-cli/bin/wp To make things easier on yourself, symlink it:

Loading

Read More

Drupal 7: Display Page Elements Conditionally

In Drupal you often need to show page elements conditionally, usually based on variables like the URL or user identity. Fortunately, the Drupal API offers several functions that can help: hook_html_head_alter() template_preprocess_page() template_preprocess_html() drupal_match_path() drupal_get_http_header() user_is_logged_in() or user_is_anonymous() Modify the Page Header To add a tag to the header on every page, use hook_html_head_alter() in […]

Loading

Read More