Change and Update WordPress URLS in Database When Site is Moved to new Host

After migrating a WordPress site to a new URL either to a live production site or a testing development server, the new URL strings in the MySQL database need to be changed and updated in the various MySQL database tables. This…

Adding Multiple Fading Images To A Background with jQuery

You can add multiple sliding/fading images to a background HTML element using the Backstretch jQuery plugin, this is great if you just want to alternate a number of images behind another web page element similar to a slider but without…

Adding a Sticky Footer to Beaver Builder Theme with CSS

A sticky footer refers to a web page footer that sticks to the foot of the page even when there is not a lot of content on the page, without one the footer will ride up leaving the layout somewhat unsightly.  …

Hide WooCommerce Product Categories on Shop Page or other Page

hide-prod-cat-woocommerce-page

You can hide certain WooCommerce product categories from the shop page or other targetted pages, by using an action called woocommerce_product_query Add it in your theme via functions.php and it works like so… So the action is wrapped in a…

Installing WordPress wp-cli on macOS

wp-cli-macos

Installing  wp-cli on macOS – WordPress has a command line tool which operates similar to what Drush does for Drupal, it is called wp-cli and runs on macOS/Linux operating systems with a minimum of PHP 5.3.2 or later and WordPress 3.5.2 or later. Install wp-cli…

Add Taxonomy Terms as CSS Classes to a Post

add-tax-terms-css-posts

You can use the body_class filter in WordPress to add the Taxonomy Terms of a Custom Taxonomy as CSS classes to a post. The CSS class appears in the body element and is only used if the post has been…

Change the WordPress Post Type name to Something Else

wordpress-rename-post-type

You can change the default Post type name in WordPress from Posts to something else like News using the get_post_type_object, normal behaviour of the Posts occur, just the label name in the WordPress dashboard has been changed.   add_action( ‘init’, ‘cp_change_post_object’…

Create Shortcode for the Permalink in WordPress

shortcode for permalink in wordpress

You can create a shortcode for the permalink in WordPress to use in a string output or more likely as a value for a link attribute, this can be handy if you can’t use PHP in a certain interface. add_shortcode(…

Anchor Link Offset to Other Pages with Fixed Header Size

anchor-offset-links

Here is a snippet of code that will link to an anchor link on another page with a fixed offset which allows for a fixed header size, so the link appears further down below the header of further down the…

Add Search Icon After Menu using Beaver Themer with the Beaver Theme

add-search-icon-to-menu

Here’s how you can add a search icon after a menu in a header done in the Beaver Theme using Beaver Themer. Create a Shortcode for the Beaver Builder Search function add_shortcode( ‘bb_search’,’bb_search_shortcode’ ); /* Add Search via shortcode */…