Neil Matthews

Author: Neil Matthews

  • Elevating Your Location Data: A Guide to Storing Latitude and Longitude with ACF Google Map Field

    Elevating Your Location Data: A Guide to Storing Latitude and Longitude with ACF Google Map Field

    Introduction: Latitude and Longitude with ACF Google Map

    In this technical blog post, we’ll not only explore the importance of storing latitude and longitude as separate fields alongside ACF Google Map data but also provide you with the code snippets to seamlessly save this information. Join us on this journey to enhance your location-based queries and improve the efficiency of your WordPress site.

    Storing Latitude and Longitude Data:

    Before we dive into the code, let’s make sure we have separate latitude and longitude fields within the ACF field group.

    1. Modify ACF Field Group: Open your ACF field group and ensure you have added two additional fields named latitude and longitude.
       add_action('acf/init', 'my_acf_init');
       function my_acf_init() {
          acf_add_local_field_group(array(
             // Field group settings...
             'fields' => array(
                array(
                   'key' => 'field_latitude',
                   'label' => 'Latitude',
                   'name' => 'latitude',
                   'type' => 'number',
                   // Additional settings...
                ),
                array(
                   'key' => 'field_longitude',
                   'label' => 'Longitude',
                   'name' => 'longitude',
                   'type' => 'number',
                   // Additional settings...
                ),
                array(
                   'key' => 'field_location',
                   'label' => 'Location',
                   'name' => 'location',
                   'type' => 'google_map',
                   // Additional settings...
                ),
                // Other fields...
             ),
          ));
       }

    Saving Latitude and Longitude Data:

    Now, let’s add the necessary code to automatically save the latitude and longitude values when a user selects a location on the Google Map field.

    1. Hook into ACF Save Post Action:
       add_action('acf/save_post', 'save_latitude_longitude', 20);
    
       function save_latitude_longitude($post_id) {
          // Ensure this is not an autosave or a post revision.
          if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return;
          if (wp_is_post_revision($post_id)) return;
    
          // Check if the post type is the one associated with your ACF field group.
          if (get_post_type($post_id) === 'your_custom_post_type') {
             // Get the location data from the Google Map field.
             $location = get_field('location', $post_id);
    
             // Save latitude and longitude to their respective fields.
             if ($location) {
                update_field('latitude', $location['lat'], $post_id);
                update_field('longitude', $location['lng'], $post_id);
             }
          }
       }

    Replace 'your_custom_post_type' with the actual post type associated with your ACF field group.

    Conclusion: Latitude and Longitude with ACF Google Map

    By incorporating separate latitude and longitude fields alongside the ACF Google Map field and implementing the provided code snippets, you can effortlessly enhance your WordPress site’s ability to store and retrieve location data. This approach not only optimizes location-based queries but also streamlines the process of working with geospatial information in your applications.

    If you need help doing radius searches on ACF Google map data get in touch.

    Photo by Dariusz Sankowski on Unsplash

  • Outputting ACF GOOGLE MAP Data to Your WordPress Site

    Outputting ACF GOOGLE MAP Data to Your WordPress Site

    Introduction Outputting ACF GOOGLE MAP Data:

    The Advanced Custom Fields (ACF) Google Map field is a game-changer for websites that require location-based data visualization. In this blog post, we’ll guide you through the process of outputting ACF Google Map data to the front end of your WordPress site, turning coordinates into interactive maps for your users to explore. Let’s dive into the implementation details with some helpful code snippets.

    Setting Up ACF Google Map Field:

    Before we jump into the code, ensure you have the ACF plugin installed and activated on your WordPress site. Create a custom field group with a Google Map field, configuring it to meet your specific needs. Note that the field should be associated with the post type or page where you want to display the map.

    Outputting ACF Google Map Data to Frontend:

    1. Retrieve ACF Google Map Data: Use the ACF get_field function to retrieve the map data associated with a post or page. Ensure that you replace 'your_map_field_name' with the actual name of your Google Map field.
       <?php
       $map_data = get_field('your_map_field_name');
       ?>
    1. Outputting the Map: Once you have the map data, you can output it on the frontend using HTML and JavaScript. ACF provides a helpful function, acf_get_location, that can be used to format the map data.
       <?php
       $location = acf_get_location($map_data);
       ?>
       <div id="map-container">
          <div id="map" data-lat="<?php echo esc_attr($location['lat']); ?>" data-lng="<?php echo esc_attr($location['lng']); ?>"></div>
       </div>
    1. Adding JavaScript for Interactivity: To make the map interactive, you’ll need to include some JavaScript. This can be done using the Google Maps API. Don’t forget to replace 'your_google_maps_api_key' with your actual API key.
       <script src="https://maps.googleapis.com/maps/api/js?key=your_google_maps_api_key&callback=initMap" async defer></script>
       <script>
          function initMap() {
             var mapElement = document.getElementById('map');
             var lat = parseFloat(mapElement.getAttribute('data-lat'));
             var lng = parseFloat(mapElement.getAttribute('data-lng'));
    
             var map = new google.maps.Map(mapElement, {
                center: { lat: lat, lng: lng },
                zoom: 15 // You can adjust the initial zoom level
             });
    
             var marker = new google.maps.Marker({
                position: { lat: lat, lng: lng },
                map: map,
                title: 'Marker Title'
             });
          }
       </script>

    This JavaScript code initializes the Google Map, places a marker at the specified coordinates, and adjusts the map’s center and zoom level.

    Conclusion Outputting ACF GOOGLE MAP Data:

    By following these steps and integrating the provided code snippets, you can effortlessly output ACF Google Map data to the frontend of your WordPress site. This not only adds a visual appeal but also enhances the user experience by providing an interactive way for visitors to explore location-based content on your website.

    Photo by T.H. Chia on Unsplash

  • Unleashing the Power of ACF Google Map Field: A Comprehensive Guide

    Unleashing the Power of ACF Google Map Field: A Comprehensive Guide

    Introduction acf google maps:


    The Advanced Custom Fields (ACF) plugin has long been a favourite among WordPress developers for its flexibility in creating custom fields and meta-boxes effortlessly. One of the standout features of ACF is the Google Map field, which adds a whole new dimension to content creation and user engagement. In this blog post, we will delve into the ACF Google Map field, exploring its capabilities, implementation, and the myriad ways it can enhance your website.

    Understanding ACF Google Map Field:

    The ACF Google Map field is designed to simplify the process of integrating interactive maps into your WordPress website. Whether you’re creating a business directory, a travel blog, or a real estate website, this field type can elevate your content by allowing you to associate locations with posts, pages, or custom post types.

    Key Features:

    1. User-Friendly Interface:
      The ACF Google Map field provides an intuitive interface for users to pinpoint locations directly on the map. This ensures accuracy and eliminates the need for users to input latitude and longitude manually.
    2. Customization Options:
      ACF allows you to customize the appearance of the map, choosing from various map styles and controls. This ensures that the map seamlessly integrates with your website’s design.
    3. Geolocation and Address Search:
      Users can enter an address or use geolocation to automatically populate the map. This feature is particularly useful for applications where the user’s location is relevant, such as in-store locators or event planning.

    Implementation:

    1. Setting up ACF Google Map Field:
    • Install and activate the ACF plugin on your WordPress site.
    • Create a custom field group and add a new Google Map field.
    • Configure the field settings, including map center, default zoom level, and customization options.
    1. Displaying the Map on the Frontend:
    • Integrate the ACF Google Map field into your theme or template files using the ACF functions.
    • Retrieve and display the map data within your desired loop or content area.

    Use Cases:

    1. Location-Based Directories:
      Build robust business directories, store locators, or event listings by associating a Google Map with each entry. Users can easily find and visualize the location.
    2. Real Estate Websites:
      Enhance property listings by including an interactive map that showcases the exact location of each property. This provides potential buyers with a better understanding of the property’s surroundings.
    3. Travel Blogs:
      Create engaging travel blogs by adding maps to showcase the places you’ve visited. Users can click on markers to reveal more information about each location.

    Conclusion acf google maps:

    The ACF Google Map field is a powerful tool that adds a dynamic and interactive element to your WordPress website. Its versatility makes it suitable for a wide range of applications, providing a seamless way to integrate location-based information into your content. Whether you’re a developer looking to streamline the creation of custom fields or a website owner aiming to enhance user experience, the ACF Google Map field is a valuable addition to your toolkit.

    If you need help implementing Google maps on your WordPress site please get in touch.

    Photo by GeoJango Maps on Unsplash

  • CASE STUDY: ACF Google Map Radius Search

    CASE STUDY: ACF Google Map Radius Search

    In this case study I’ll walk through how I was able to create a radius search from Google map data for a client.

    It’s a bit technical if you just want to see the output, scroll down to the video for a demo of the front end.

    My clients requirement was for a user to enter their Zip code and then for the code to search on a custom post type called location and return all locations within a 100 mile radius.

    We had attached an ACF google map field to the custom post type so we could save the address data of the location on the post, I created a map and I could output all of the data points on the map, so far so good.

    Problem One – Google Maps Latitude and Longitude Data Is Serialised

    The data is serialised so it is very hard to search on an ACF google map, so I create two new fields (latitude and longitude) and upon save of the custom post type I grab the ACF field latitude and longitude and save them into their own fields.

    function nm_update_lat_long($post_id){
    	
    	$post_type = get_post_type( $post_id );
    
        if ( 'location' == $post_type ) {
    	
    		$xxx_map= get_field('xxx_google_map', $post_id);
    	
    		$_POST["acf"]["field_65b8c2e984961"]=$xxx_map['lat'];
    		$_POST["acf"]["field_65b8c2fb84962"]=$xxx_map['lng'];
    	
    		return $_POST;
    	}
    }
    
    add_action('acf/save_post', 'nm_update_lat_long',1);

    Convert Zip Code TO Co-Ordinates

    Using the Google maps API I can do a search using a zip code and return a set of latitude and longitude co-ordinates I can use to create my search are. The code looks like this.

    function nm_get_coords_zip_code($zip){
    	
    	
    	$api_key=get_field('xxx_options_google_map_api_key','options'); 
    	$url = "https://maps.googleapis.com/maps/api/geocode/json?address=".$zip."&sensor=false&key=".$api_key;
            $details=file_get_contents($url);
            $result = json_decode($details,true);
            $account_lat=$result['results'][0]['geometry']['location']['lat'];
            $account_long=$result['results'][0]['geometry']['location']['lng'];
    	return array($account_lat,$account_long);
    	
    }

    The Search Box

    Using maths I’ve not used since school, I was able to return a box which is 100 miles radius of my zip code. Who am I kidding I found it on stack overflow.

    function nm_getBoundingBox($lat_degrees,$lon_degrees,$distance_in_miles) {
    
        $radius = 3963.1; // of earth in miles
    
        // bearings - FIX   
        $due_north = deg2rad(0);
        $due_south = deg2rad(180);
        $due_east = deg2rad(90);
        $due_west = deg2rad(270);
    
        // convert latitude and longitude into radians 
        $lat_r = deg2rad($lat_degrees);
        $lon_r = deg2rad($lon_degrees);
    
        // find the northmost, southmost, eastmost and westmost corners $distance_in_miles away
        // original formula from
        // http://www.movable-type.co.uk/scripts/latlong.html
    
        $northmost  = asin(sin($lat_r) * cos($distance_in_miles/$radius) + cos($lat_r) * sin ($distance_in_miles/$radius) * cos($due_north));
        $southmost  = asin(sin($lat_r) * cos($distance_in_miles/$radius) + cos($lat_r) * sin ($distance_in_miles/$radius) * cos($due_south));
    
        $eastmost = $lon_r + atan2(sin($due_east)*sin($distance_in_miles/$radius)*cos($lat_r),cos($distance_in_miles/$radius)-sin($lat_r)*sin($lat_r));
        $westmost = $lon_r + atan2(sin($due_west)*sin($distance_in_miles/$radius)*cos($lat_r),cos($distance_in_miles/$radius)-sin($lat_r)*sin($lat_r));
    
    
        $northmost = rad2deg($northmost);
        $southmost = rad2deg($southmost);
        $eastmost = rad2deg($eastmost);
        $westmost = rad2deg($westmost);
    
        // sort the lat and long so that we can use them for a between query        
        if ($northmost > $southmost) { 
            $lat1 = $southmost;
            $lat2 = $northmost;
    
        } else {
            $lat1 = $northmost;
            $lat2 = $southmost;
        }
    
    
        if ($eastmost > $westmost) { 
            $lon1 = $westmost;
            $lon2 = $eastmost;
    
        } else {
            $lon1 = $eastmost;
            $lon2 = $westmost;
        }
    
        return array($northmost, $southmost, $eastmost, $westmost);
    }

    The Query

    I setup a query to search the data looking for locations within the bounds of the co-ordinates I had grabbed from the search box in the previous step. I saved those co-ordinates in an erray $distance_box. Here are the query arguments I used.

    $args = array(
    	'post_type'	=> 'location',
    	'post_status' => 'publish',	
    	
    	'meta_query'	=> array(
    		 'relation' => 'AND', 
    		
    		array(
    			'key'		=> 'xxx_latitude',
    		
    			'value'		=> array($distance_box[1]),
    			'compare'	=> '>=',
    			'type' => 'NUMERIC',
    		),
    		
    				array(
    			'key'		=> 'xxx_latitude',
    			'value'		=> array($distance_box[0]),
    			'compare'	=> '<=',
    			'type' => 'NUMERIC',
    		),
    		
    		
    		array(
    			'key'		=> 'xxx_longitude',
    		
    			'value'		=> array($distance_box[2]),
    			'compare'	=> '<=',
    			'type' => 'NUMERIC',
    		),
    		
    				array(
    			'key'		=> 'xxx_longitude',
    			'value'		=> array($distance_box[3]),
    			'compare'	=> '>=',
    			'type' => 'NUMERIC',
    		),
    		
    		
    	)	
    		
    	
    );

    Video Demo

    Here’s what it looks like on the front end.

    Wrap Up – Radius Search ACF Google Map Field

    So here’s my case study on how to search ACF google map fields via a 100 mile radius.

    If you need help implementing Google maps on your site please get in touch.

    Photo by José Martín Ramírez Carrasco on Unsplash

  • Troubleshooting Guide: Fixing WordPress 404 Errors on Sub-Pages by Flushing Permalinks

    Troubleshooting Guide: Fixing WordPress 404 Errors on Sub-Pages by Flushing Permalinks

    Introduction – Fixing WordPress 404 Errors on Sub-Pages

    Encountering 404 errors on sub-pages of your WordPress site can be a frustrating experience, especially when the main page is accessible. Fortunately, one common solution to this issue is to flush permalinks. In this troubleshooting guide, we’ll walk you through the steps to resolve the problem and restore access to your WordPress sub-pages.

    Identifying the Issue:

    1. Confirming the Problem:
    • Access the main page of your WordPress site. If it loads correctly, but sub-pages return 404 errors, it’s likely a permalink issue.
    1. Checking Permalink Settings:
    • Log in to your WordPress admin dashboard.
    • Navigate to “Settings” and select “Permalinks.”
    • Confirm your permalink structure settings and check if any recent changes were made.

    Resolving the Issue:

    1. Flushing Permalinks:
    • The primary solution to address 404 errors on sub-pages is to flush permalinks.
    • Navigate to “Settings” and select “Permalinks” in the admin dashboard.
    • Without making any changes, click the “Save Changes” button.
    • This action refreshes the permalink structure, resolving potential conflicts.
    1. Checking .htaccess File:
    • Ensure that your site’s root directory contains an .htaccess file.
    • Verify the file’s permissions and make sure it is writable.
    • If the file is missing, you can create a new one and add the default WordPress .htaccess rules.
    1. File and Folder Permissions:
    • Incorrect file or folder permissions might lead to 404 errors.
    • Check and ensure that the directories have a permission level of 755 and files are set to 644.
    • Consult your hosting provider or server documentation for guidance on setting permissions.
    1. Deactivating Plugins:
    • Some plugins can interfere with permalinks and cause 404 errors.
    • Temporarily deactivate all plugins and check if the issue persists.
    • If the problem resolves, reactivate plugins one by one to identify the culprit.
    1. Reviewing Theme Compatibility:
    • Switch to a default WordPress theme (e.g., Twenty Twenty-One) to rule out theme-related issues.
    • If the problem disappears with the default theme, there may be a conflict in your current theme’s functions.
    1. Checking for URL Conflicts:
    • Ensure there are no conflicting URLs or slugs.
    • Check for duplicate page or post slugs, as this can lead to conflicts.
    • Update the slugs or change the permalink structure if needed.
    1. Rebuilding Permalinks via FTP:
    • Access your site’s files using FTP.
    • Locate the .htaccess file in the root directory.
    • Rename the file to something else (e.g., .htaccess_old).
    • Go back to the Permalinks settings in the WordPress admin and click “Save Changes” to generate a new .htaccess file.

    Prevention:

    1. Regular Backups:
    • Implement regular backups of your WordPress site, including both files and the database, to restore quickly if issues arise.
    1. Plugin and Theme Updates:
    • Keep plugins and themes up to date to ensure compatibility with the latest WordPress version.

    Conclusion Fixing WordPress 404 Errors on Sub-Pages:

    Troubleshooting 404 errors on sub-pages in WordPress can often be resolved by flushing permalinks. Following the steps outlined in this guide should help you identify and address the issue efficiently. If the problem persists, consider seeking assistance from your hosting provider or a WordPress support community. Regular maintenance, backups, and staying informed about updates can contribute to a smoother WordPress experience.

    If you need help troubleshooting a problem on your WordPress site please get in touch.

    Photo by Erik Mclean on Unsplash

  • A Guide to Configuring Permalink Types in WordPress: Choose the Perfect URL Structure for Your Website

    A Guide to Configuring Permalink Types in WordPress: Choose the Perfect URL Structure for Your Website

    Introduction Guide to Configuring Permalink:

    Permalinks, the permanent URLs that point to your WordPress site’s pages and posts, are a crucial element of your website’s overall structure. WordPress offers various permalink types, allowing you to customize your URL structure to meet the specific needs of your content and improve SEO. In this blog post, we’ll explore the different permalink types available in WordPress and guide you through the process of configuring them for your website.

    Understanding Permalink Types:

    1. Default Permalinks:
      WordPress defaults to a simple structure that includes a page or post ID. While functional, these URLs are not user-friendly or SEO-optimized.
    2. Day and Name:
      This permalink type includes the publication date and post/page name. It’s beneficial for blogs or websites where the publication date is relevant.
    3. Month and Name:
      Similar to Day and Name, this structure excludes the day, resulting in shorter URLs while retaining some chronological information.
    4. Numeric:
      This permalink type includes only the post or page ID, providing a concise and clean URL structure.
    5. Post Name:
      Widely popular, Post Name structures URLs based on the title of the post or page. This creates clean, human-readable URLs, making it a preferred choice for SEO.
    6. Custom Structure:
      For maximum flexibility, you can create a custom permalink structure using various placeholders, such as %postname%, %category%, or %year%. This allows you to craft a URL format that suits your specific needs.

    Configuring Permalink Types:

    1. Accessing Permalink Settings:
    • Log in to your WordPress admin dashboard.
    • Navigate to “Settings” and select “Permalinks.”
    1. Choosing a Permalink Structure:
    • On the Permalinks settings page, you’ll find the different permalink options.
    • Select the structure that best suits your content and SEO strategy.
    1. Customizing the Permalink Structure:
    • If you choose the “Custom Structure” option, you can define your own format using placeholders.
    • For example, using /%category%/%postname%/ in the custom structure would include the category and post name in the URL.
    1. Saving Changes:
    • After selecting or customizing your preferred permalink structure, scroll down and click “Save Changes” to apply the new settings.

    Considerations and Best Practices:

    1. SEO Impact:
    • Choose a permalink structure that is SEO-friendly, emphasizing keywords relevant to your content.
    1. User Experience:
    • Prioritize a permalink structure that enhances user experience, making it easy for visitors to understand the content hierarchy.
    1. Avoiding Common Pitfalls:
    • Steer clear of changing your permalink structure frequently, as this can lead to broken links. If changes are necessary, set up proper redirects.
    1. Redirects for Existing Content:
    • If you’re changing your permalink structure on an existing site, implement redirects to ensure that old URLs still lead to the correct content.

    Conclusion: Guide to Configuring Permalink

    Configuring permalink types in WordPress is a fundamental step in optimizing your website for both users and search engines. Whether you prefer a clean and simple Post Name structure or opt for a custom format to include additional information, understanding the available options and their implications is key. By carefully selecting and configuring your permalink structure, you can create a website with URLs that are both user-friendly and optimized for search engine visibility.

    If you need help with permalinks please get in touch.

  • Mastering Permalinks in WordPress: A Comprehensive Guide to Flushing

    Mastering Permalinks in WordPress: A Comprehensive Guide to Flushing

    Introduction – Flushing Permalinks:

    Permalinks, the permanent URLs of your WordPress site, play a crucial role in both user experience and search engine optimization. When making changes to your site’s permalink structure, it’s essential to understand how to flush permalinks to ensure the changes take effect. In this technical blog post, we’ll explore various methods of flushing WordPress permalinks, covering manual approaches, plugins, and code snippets.

    Manual Methods:

    1. Admin Dashboard:
      The simplest way to flush permalinks is through the WordPress admin dashboard. Follow these steps:
    • Navigate to “Settings” in the admin menu.
    • Click on “Permalinks.”
    • Without making any changes, click the “Save Changes” button. This action triggers a permalink flush, updating the site’s URL structure based on the chosen settings.
    1. FTP or File Manager:
      If you don’t have access to the admin dashboard, you can manually flush permalinks via FTP or a file manager.
    • Locate your site’s root directory.
    • Look for a file named “.htaccess.”
    • Edit the file (make a backup first) and save it without making any changes. Editing and saving the “.htaccess” file triggers the permalink flush.

    Plugins:

    1. Permalink Manager Lite:
      The Permalink Manager Lite plugin provides a user-friendly interface for managing permalinks and flushing rewrite rules.
    • Install and activate the plugin.
    • Navigate to “Permalinks” in the admin menu.
    • Use the provided tools to customize and manage permalinks.
    • Click the “Save Changes” button to flush permalinks. This plugin not only simplifies the process but also offers advanced features for customizing individual URLs.
    1. WP Rocket:
      While primarily known for caching, the WP Rocket plugin includes a feature to manage and flush permalinks.
    • Install and activate WP Rocket.
    • Go to the plugin settings.
    • Navigate to the “File Optimization” tab.
    • Check the option for “Update.htaccess” and “Update Permalink.” Enabling these options ensures that flushing permalinks is part of the caching process.

    Code Snippets:

    1. Using PHP:
      Developers can programmatically flush permalinks using the flush_rewrite_rules() function in PHP.
       function flush_permalinks() {
           flush_rewrite_rules();
       }
       add_action('init', 'flush_permalinks');

    This code, placed in the theme’s functions.php file, ensures that permalinks are flushed during the WordPress initialization process.

    1. On Plugin Activation:
      If you want to flush permalinks when a specific plugin is activated, use the register_activation_hook function.
       function flush_permalinks_on_activation() {
           flush_rewrite_rules();
       }
       register_activation_hook(__FILE__, 'flush_permalinks_on_activation');

    Replace __FILE__ with the path to your plugin’s main file.

    Conclusion:

    Flushing WordPress permalinks is a critical step when making changes to your site’s URL structure. Whether using manual methods through the admin dashboard or file management, relying on plugins like Permalink Manager Lite or WP Rocket, or implementing code snippets for more advanced scenarios, mastering the art of flushing permalinks ensures a seamless transition and optimal performance for your WordPress website. Choose the method that best suits your workflow and development practices to keep your site’s URLs in sync with your content and configuration changes.

    Photo by Jas Min on Unsplash

  • Demystifying WordPress Custom Rewrites: A Comprehensive Guide

    Demystifying WordPress Custom Rewrites: A Comprehensive Guide

    Introduction – WordPress Custom Rewrites:

    WordPress, the widely-used content management system (CMS), empowers millions of websites with its flexibility and user-friendly interface. One of the key features that contributes to this flexibility is the ability to customize URL structures through a mechanism known as custom rewrites. In this blog post, we’ll dive into the world of WordPress custom rewrites, exploring what they are, how they work, and why they are essential for shaping the structure of your website’s URLs.

    Understanding Permalinks:

    Before we delve into custom rewrites, it’s crucial to understand the concept of permalinks in WordPress. Permalinks, short for permanent links, are the URLs that lead to your website’s pages and posts. WordPress provides default permalink structures, but users often prefer to create custom ones for various reasons, such as improving SEO, enhancing user experience, or aligning with a specific content structure.

    Custom Permalinks vs. Custom Rewrites:

    While custom permalinks allow users to alter the general structure of URLs, custom rewrites take the customization a step further. Custom rewrites enable users to define specific URL patterns and rewrite rules, providing unparalleled control over the structure of permalinks. This level of customization is particularly valuable for complex websites or those with unique content structures.

    Anatomy of WordPress Custom Rewrites:

    1. Rewrite Rules:
      At the heart of custom rewrites are rewrite rules. These rules define the structure of the URLs and how they map to the underlying content. Each rule consists of a pattern, which matches the requested URL, and a corresponding destination, which points to the actual content.
       function custom_rewrite_rules() {
           add_rewrite_rule('^custom-page/([^/]+)/?', 'index.php?custom_var=$matches[1]', 'top');
       }
       add_action('init', 'custom_rewrite_rules');

    In this example, the pattern ‘^custom-page/([^/]+)/?’ captures the requested URL, and ‘index.php?custom_var=$matches[1]’ indicates the destination, passing the captured value as a parameter.

    1. Query Variables:
      Custom rewrites often involve passing additional parameters to WordPress, which can then be used to query the database for the relevant content. In the example above, ‘custom_var’ is a custom query variable that holds the value captured from the URL pattern.
       function custom_query_vars($query_vars) {
           $query_vars[] = 'custom_var';
           return $query_vars;
       }
       add_filter('query_vars', 'custom_query_vars');

    This code snippet ensures that WordPress recognizes ‘custom_var’ as a valid query variable.

    1. Flushing Rewrite Rules:
      After adding or modifying custom rewrite rules, it’s essential to flush the existing rules to ensure the changes take effect. This can be done by visiting the WordPress Permalinks settings page or programmatically using the flush_rewrite_rules() function.
       function flush_custom_rewrite_rules() {
           flush_rewrite_rules();
       }
       register_activation_hook(__FILE__, 'flush_custom_rewrite_rules');

    The register_activation_hook ensures that the rewrite rules are flushed when the plugin or theme is activated.

    Practical Use Cases:

    1. Creating Custom Endpoints:
      Custom rewrites are handy when creating custom endpoints for specific types of content, such as portfolios, testimonials, or events. This allows for a more organized and intuitive URL structure.
    2. Enhancing SEO:
      Crafting SEO-friendly URLs is crucial for improving search engine visibility. With custom rewrites, you can structure URLs to include relevant keywords and improve the overall SEO performance of your website.
    3. Building Virtual Pages:
      Custom rewrites enable the creation of virtual pages that don’t have a physical existence in the database. This is useful for displaying dynamically generated content based on specific criteria.

    Conclusion – WordPress Custom Rewrites:

    WordPress custom rewrites empower website owners and developers with the ability to sculpt URL structures according to their unique needs. By understanding the anatomy of custom rewrites and exploring practical use cases, you can leverage this powerful feature to enhance the user experience, improve SEO, and organize your website’s content more effectively. Experiment with custom rewrites to unlock new possibilities and tailor your WordPress site to meet the specific requirements of your project.

    If you need help setting up a custom rewrite for your site please get in touch.

    Photo by Unseen Studio on Unsplash

  • This One Thing Will Make Your Projects Run More Smoothly

    This One Thing Will Make Your Projects Run More Smoothly

    As the title suggests, this one thing will make your projects run more smoothly if you implement it on a regular basis!

    Picture the scenario, you are a freelancer and you are providing a service to your client. You work remotely and never meet up in person with the people who contract you.

    The Problem is, it is very hard to see progress of a project with remote workers, it’s our duty as a freelancer to let your client know exactly where you are in the project so they have visibility of the work done.

    Add this small thing to add into your daily process and you will keep you client’s happy, and what do happy client’s create … more work.

    Drum Roll – End Of Day Update Video

    It’s super simple, record a one minute video of the work done using screencast software at the end of each day and send it to your client.

    Walk through the work done, show your client what you have achieved and how the project is moving forward towards completion.

    It’s a very simple thing, you show your client where you are, and how their money is being spent.

    Scratching My Own Itch

    I started to do this as a result of my work with sub-contractors on projects. I saw the problem live and wanted to scratch that itch with my own work.

    I would pass my freelancer a requirements and it would go very quiet. I did not know where they were in the timeline, and even if they were working on my tasks.

    Paying a contractor to do work for you takes a lot of trust, you are paying people to do a task for you and expect it to be completed on time and to budget.

    I would fret that with work was in progress, or even worse I would start to micro-manage my contractors to get status updates, nobody likes that.

    Add into this mix different timezones and things get messy quickly

    I realised my clients would be thinking this about my services delivery so I started to add and end of day update to my daily process.

    Example End Of Day Update

    Here’s an example of what I would send to a client, the project is my internal AI development projects but it’s a real example of what I would do.

    https://app.screencast.com/ZGw7zpO422Y7g

    It doesn’t need to be hugely in-depth, just a quick check-in to show progress is being made.

    Software I Use

    You don’t need expensive software to do add this process to your working day., my preferred tool is TechSmith screen capture (formerly Jing), there is a free version, but I pay $10 per month for the pro version.

    Another great alternative is Loom, again the free version is great and the paid version it not too expensive.

    Testimonial

    I got a testimonial from one of my clients Nate recently and he highlighted the end of day update and how it made our project run more smoothly.

    Neil stepped in when we had a contractor fail to deliver. Once Neil took over, I got daily update videos. I always knew where we were in the process and saw the product developing daily. The deliverable was perfect and easy to use. Neil understood what we were trying to do, implemented revision feedback seamlessly, and developed custom solutions that I didn’t even know were possible. Could not recommend Neil enough.

    Nate Banker – CEO Banker Creative

    Wrap Up – This One Thing Will Make Your Projects Run More Smoothly

    It’s a very simple thing, but implement this and you will thrill your clients. This makes you look very professional, keeps your clients in the loop and leads to more projects.

    I’ve heard so many horror stories about freelancers going AWOL, keep your clients updated!

    If you would like to work with me after learning a little more about my processes please get in touch.

    Photo by Aaron Burden on Unsplash

  • Elevate Your WordPress Site: The Impact of Number Counters as Social Proof

    Elevate Your WordPress Site: The Impact of Number Counters as Social Proof

    Introduction -Number Counters :

    In the competitive realm of online business, establishing trust and credibility is paramount. As visitors explore your WordPress site, they seek reassurance that your products or services have a proven record of success. An effective strategy to convey this is through the incorporation of numbers counters, showcasing metrics such as clients served and projects completed. In this blog post, we’ll delve into the transformative potential of numbers counters and how integrating them into your WordPress site can serve as compelling social proof, bolstering confidence in your brand.

    Harnessing the Power of Quantifiable Success:

    1. Instant Credibility:
      Numbers counters provide instant credibility by transparently displaying the number of clients served or projects completed. This quantitative data serves as concrete evidence of your experience and success, immediately conveying the scale and reliability of your business.
    2. Building Trust Through Transparency:
      The use of numbers counters promotes transparency, showcasing your business’s accomplishments openly. This commitment to openness and honesty builds trust, a critical factor in establishing a strong connection with your audience.
    3. Visual Impact:
      Numbers counters are visually impactful elements that capture visitors’ attention. The dynamic nature of counters, especially those that increment over time, creates a sense of momentum and progress, enticing viewers to delve deeper into your offerings.

    Leveraging Numbers Counters as Social Proof:

    1. Clients Served:
      Highlighting the number of clients served is a potent form of social proof, indicating that your products or services have successfully met the needs of a substantial customer base. This statistic implies a level of reliability and satisfaction that resonates positively with potential clients.
    2. Projects Completed:
      Displaying the number of projects completed showcases your business’s expertise and capability. It communicates that you’ve navigated diverse challenges, honed your skills, and consistently delivered results. This social proof is particularly influential in industries where tangible outcomes matter.
    3. Ongoing Success:
      Opt for dynamic numbers counters that increment over time to convey ongoing success. This creates a sense of momentum, communicating to visitors that your business is actively thriving and growing.

    Implementing Numbers Counters on Your WordPress Site:

    1. Select a Robust Plugin:
      Choose a reliable WordPress plugin that simplifies the integration and customization of numbers counters. Plugins like Count-Up or Digits offer user-friendly interfaces and versatile styling options.
    2. Strategic Placement:
      Feature your numbers counters prominently on your homepage, landing pages, or in your website’s header. Strategic placement ensures that visitors encounter this impactful social proof early in their journey, influencing their perception positively.
    3. Regular Updates:
      Keep your numbers counters up-to-date to reflect the latest statistics. Regular updates showcase ongoing success and demonstrate that your business is continually achieving milestones.

    Conclusion – Number Counters :

    Incorporating numbers counters into your WordPress site is a dynamic strategy to leverage quantifiable success as social proof. Whether it’s the number of clients served or projects completed, these counters create an immediate and lasting impact on your visitors. Elevate your brand’s credibility, build trust, and influence potential clients with the persuasive visual appeal of numbers counters. Turn your achievements into a powerful form of social proof with the help of reliable plugins like Count-Up and Digits.

    If you need help implemnting a number counter for social proof, please get in touch.

    Photo by Nick Hillier on Unsplash

  • Case Studies As Social Proof, Leveraging Success Stories

    Case Studies As Social Proof, Leveraging Success Stories

    Introduction – Case Studies As Social Proof:

    In the ever-evolving digital landscape, building trust with potential customers is a cornerstone of successful online businesses. While testimonials and reviews offer valuable insights into customer satisfaction, case studies take social proof to the next level. In this blog post, we’ll explore how adding case studies to your website can significantly enhance your brand’s credibility, influence customer perceptions, and ultimately drive conversions.

    Unveiling the Power of Case Studies:

    1. Real-world Application:
      Case studies provide a detailed narrative of how your product or service has been applied in real-world scenarios. By showcasing tangible examples of success, you bridge the gap between theory and practice, offering potential customers a glimpse into the practical benefits of choosing your offerings.
    2. Building Trust Through Transparency:
      Transparency is key in the digital age, and case studies serve as a transparent window into your business’s capabilities. By openly sharing the challenges faced by your clients and how your solutions addressed those challenges, you establish authenticity and build trust with your audience.
    3. Demonstrating Expertise:
      A well-crafted case study not only highlights successful outcomes but also showcases your expertise in your industry. It provides an opportunity to demonstrate your in-depth understanding of your clients’ needs and your ability to deliver effective solutions.

    How Case Studies Create Social Proof:

    1. Concrete Results Speak Volumes:
      Case studies present concrete evidence of the positive impact your products or services have had on your clients’ businesses. Quantifiable results, such as increased revenue, improved efficiency, or enhanced customer satisfaction, serve as compelling social proof of your capabilities.
    2. Relatable Success Stories:
      Unlike generic testimonials, case studies offer a deeper dive into the specific challenges faced by your clients and how your offerings provided solutions. Potential customers are more likely to connect with and be influenced by relatable success stories that mirror their own circumstances.
    3. Overcoming Objections:
      Case studies can address common objections or concerns potential customers may have. By showcasing how your offerings successfully addressed similar challenges faced by others, you proactively alleviate doubts and increase the likelihood of conversion.

    Integrating Case Studies into Your Website:

    1. Diverse Formats:
      Present case studies in diverse formats to cater to different preferences. Consider using written narratives, video testimonials, infographics, or a combination of these to make your success stories more engaging and accessible.
    2. Strategic Placement:
      Feature case studies prominently on your website, especially on key landing pages or product/service pages. Strategic placement ensures that visitors encounter social proof at crucial points in their customer journey.
    3. Encourage Sharing:
      Leverage the shareability of case studies to amplify their impact. Encourage clients featured in case studies to share their success stories on their own platforms, broadening the reach of your social proof.

    Conclusion – Case Studies As Social Proof:

    Incorporating case studies into your website is a strategic move that goes beyond traditional social proof methods. By showcasing real-world success stories, you not only build trust and credibility but also position your brand as a reliable solution provider. Take advantage of the persuasive nature of case studies to influence potential customers, overcome objections, and drive conversions. Elevate your online presence with the undeniable power of case studies, turning your success stories into a compelling form of social proof.

    If you need help implementing case studies on your site give me a call.

    Photo by Alexander Grey on Unsplash

  • Testimonials as social proof: Elevating Your WordPress Site with Social Proof

    Testimonials as social proof: Elevating Your WordPress Site with Social Proof

    Introduction – Testimonials as social proof:

    In the dynamic landscape of online business, establishing trust with your audience is paramount. As potential customers navigate through the virtual marketplace, they seek reassurance that your products or services are reliable and of high quality. One of the most compelling forms of social proof to achieve this is through testimonials. In this blog post, we’ll delve into the significance of testimonials as a powerful social proof tool on WordPress sites and introduce you to some standout plugins that can seamlessly elevate your testimonial game.

    The Role of Testimonials in Building Trust:

    1. Authenticity and Relatability:
      Testimonials are real-world narratives from satisfied customers, offering a glimpse into their experiences with your products or services. This authenticity and relatability resonate strongly with potential buyers, providing them with valuable insights into what they can expect.
    2. Establishing Credibility:
      Trust is built on credibility, and testimonials act as a virtual endorsement of your business. Positive feedback from happy customers serves as a testament to your reliability, professionalism, and commitment to customer satisfaction.
    3. Influencing Purchase Decisions:
      Testimonials play a crucial role in the decision-making process. Prospective customers are more likely to convert when they see others who have benefited from your offerings. Well-crafted testimonials can tip the scales in your favor, nudging hesitant buyers towards making a confident purchase.

    Enhancing Your WordPress Site with Testimonial Plugins:

    To make the most of testimonials on your WordPress site, consider integrating these top-notch plugins:

    1. Easy Testimonials:
      This user-friendly plugin allows you to collect and display testimonials effortlessly. With various customization options, Easy Testimonials seamlessly integrates with your site’s design, ensuring a polished and professional appearance.
    2. Strong Testimonials:
      Offering a versatile range of features, Strong Testimonials empowers you to showcase customer feedback in multiple formats. From text and images to video testimonials, this plugin adds a dynamic element to your site’s social proof.
    3. Testimonial Rotator:
      Keep your testimonials fresh and engaging with Testimonial Rotator. This plugin enables you to display a rotating selection of testimonials, preventing your site from becoming stagnant and adding a dynamic touch to your social proof strategy.
    4. WP Customer Reviews:
      WP Customer Reviews goes beyond traditional testimonials by allowing customers to leave reviews directly on your site. This plugin supports both star ratings and written feedback, providing a comprehensive view of customer satisfaction.

    Implementing Testimonials for Maximum Impact:

    1. Strategic Placement:
      Display testimonials strategically on your WordPress site. Consider placing them on product pages, landing pages, or even in the footer to maximize visibility and impact.
    2. Diverse Content:
      Include a variety of testimonials, including written quotes, customer photos, and even video testimonials. Diverse content formats cater to different preferences and add depth to your social proof.
    3. Regular Updates:
      Keep your testimonials up-to-date. Periodically refresh the testimonials showcased on your site to reflect recent positive experiences, ensuring that your social proof remains current and relevant.

    Conclusion – Testimonials as social proof:

    Harnessing the power of testimonials as social proof is a game-changer for your WordPress site. By incorporating authentic and compelling customer feedback, you not only build trust but also influence purchasing decisions positively. Explore the suggested plugins to effortlessly integrate testimonials into your site, creating a more persuasive and customer-centric online presence. Elevate your brand with the undeniable impact of social proof and watch as your audience transforms into loyal, confident customers.

    If you want to implement testimonials on your site, give me a shout.

    Photo by Mert Talay on Unsplash