This is my repository of code snippets, url links, and other stuff that I use to develop website with. The main purpose of this site is to catalog, and easy search for the stuff that I use on a regular basis.
Sometimes the action scheduler can create huge database files that affect the performance of WordPress, and intervention is required. These queries can help clean up these tables. Remove all rows from the table wp_actionscheduler_actions that contain the statuses complete, failed, or canceled: Clean up the log files: Add to functions.php to change the […]
source: https://ithoughtyoucouldusethis.com/resize-image-uploaded-through-gravity-forms/
SSH Keys for Authentication ssh-keygen has already been run on the local computer, just need to add it to the new server. Use the following command to copy authentication to the new server: Make sure common apps are installed on the server Setup AutoMySQLBackup config file location: /etc/default/automysqlbackup default database backup location: /var/lib/automysqlbackup
WordPress has a secret options page to update values in the options table. Access it by changing the options page URL from /options-general.php to /options.php. I have found this useful for updating the admin email address since they have an authorization feature now. This let me skirt this feature for making a change to the […]
Modifying “Print Invoices & Packing Lists” WooCommerce add-on to remove unwanted columns. This will remove the sku column from the invoice, and the weights column from the packing list. The weight column was the primary reason for this code, and makes it simple to eliminate unwanted information. source: https://www.skyverge.com/blog/modifying-print-invoices-packing-lists-templates/
Change the default wordpress search, and limit the results to only specific post types. Change the array that is set to only include the post types that you want returned for the search. reference: https://www.wpbeginner.com/wp-tutorials/how-to-limit-search-results-for-specific-post-types-in-wordpress/
Working with dates in PHP can get cumbersome. Especially when you need to calculate a date occurrence in the past or future. These examples should help get those dates, and output them in a human readable format. PHP Date Formatting Y 4 digit year (2018) y 2 digit year (18) F Long month (January) M […]
Using the custom menu builder in wordpress to output submenus with the following code. Useful when you want to add dynamic submenus to the sidebar based on the parent child layout from the menu builder. I prefer this to the old method of assigning parent child relationships on the page settings, since we already have […]
CDN resources are useful for including common scripts, but the jquery ui script also requires the stylesheets. The following code will add the jqueryui stylesheets for the proper version that is included with wordpress. reference: https://stackoverflow.com/questions/8849684/wordpress-jquery-ui-css-files
Stop using @import in child themes. Use the following code in your functions.php file to enqueue the parent theme style.css file, and avoid using @import. reference: https://konstantin.blog/2014/child-themes-import/