This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Update URLs in the WordPress database when migrating from old URL to new URL. | |
* | |
* This function updates various tables and fields in the WordPress database to reflect the new URL | |
* when migrating a WordPress site. | |
* | |
* Usage: | |
* - Backup your WordPress database before running this function. | |
* - Call the function with the old URL and new URL as arguments to execute the updates. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get posts from Custom Post Type grouped by Custom Taxonomy | |
* | |
* Gist Keywords: wordpress, custom post types, cpt, taxonomy | |
* Author: Knol Aust | |
* Version: 1.0.0 | |
* Description: This code retrieves posts from a custom post type and groups them by a custom taxonomy. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Remove Unnecessary WordPress Header Clutter | |
* | |
* This code snippet removes unnecessary elements from the WordPress header to improve page load and security. | |
* Place this code in your theme's functions.php file. | |
* | |
* Gist Keywords: wordpress, security, performance | |
* | |
* @category Performance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Check if Page is a Child of Another Page | |
* Gist Keywords: wordpress, parent, child, hierarchy | |
* | |
* @category WordPress | |
* @author Knol Aust | |
* @version 1.0.0 | |
* @description Function to determine if the current page is a child of a specific parent page. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Custom REST API Endpoint: Get Home Content | |
* Gist Keywords: wordpress, api, rest, content | |
* | |
* @category WordPress | |
* @author Knol Aust | |
* @version 1.0.0 | |
* @description Retrieves featured content and the three most recent posts via a custom REST API endpoint. This example shows you can use one endpoint to pull in various queries from the API for a page like frontpage. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Automatically Create WordPress Admin Account | |
* Gist Keywords: wordpress, admin, user | |
* | |
* @category WordPress | |
* @author Knol Aust | |
* @version 1.0.0 | |
* @description Automatically creates a WordPress admin account with specified credentials if it doesn't exist. Function should only be run once to inject the user and removed from functions.php when completed. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Adds better responsive images to DIVI theme | |
* Gist Keywords: wordpress, divi, enqueue | |
* | |
* @category WordPress | |
* @author Knol Aust | |
* @version 1.0.0 | |
* @description Adds better responsive images to DIVI | |
*/ |
OlderNewer