Welcome to WP Beaches

WordPress Websites design specialists, based in the Northern Beaches, Sydney
Design, Develop, Host

RECENT POSTS

Show related posts from one CPT to another with ACF Relationships

acf-relationship

Showing related posts from one Custom Post Type to another is possible with an ACF Relationship field. This tutorial uses 2 CPTs, ‘Lights’ and ‘Projects’, the intent is to show the ‘Lights’ used in each ‘Project’ so the reader can click the link back to see the light from a project CPT. (This is also…

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 method just uses the whole MySQL database rather than a WordPress export/import from within and…

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 the overhead of using a slider plugin. Image Preparation Generally you’ll want to optimize your…

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.   There are various methods to add a sticky footer, some javascript and others CSS, you…

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 conditional statement that targets the pages you want the Product Categories to not display. Then…

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 on macOS curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar Verify Install neilg@[~]: php wp-cli.phar –info PHP binary: /usr/bin/php PHP…

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 assigned to the taxonomy. The code goes in your functions.php file.   add_filter( ‘body_class’, ‘themeprefix_add_taxonomy_class’…

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’ ); // Change dashboard Posts to News function cp_change_post_object() { $get_post_type = get_post_type_object(‘post’); $labels =…

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( ‘my_permalink’, ‘my_permalink’ ); // The Permalink Shortcode function my_permalink() { ob_start(); the_permalink(); return ob_get_clean(); }…