This file is a collection of useful WordPress database queries. These queries range from clean up and maintenance to enhancements and recovery. Commands are listed in no particular order...
TOC
<?php | |
//Determine the wordpress page type | |
function detectPageType() { | |
if ( is_front_page() && get_option('show_on_front') == 'posts' ) { | |
$pageType = 'front-page'; | |
} else if ( is_home() && get_option('show_on_front') == 'page' ) { | |
$pageType = 'front-page'; | |
} else if ( is_attachment() ) { |
This file is a collection of useful WordPress database queries. These queries range from clean up and maintenance to enhancements and recovery. Commands are listed in no particular order...
TOC
<?php | |
/* | |
Plugin Name: Test plugin | |
Description: A test plugin to demonstrate wordpress functionality | |
Author: Chris Steurer | |
Version: 0.0.1 | |
*/ | |
/** |
WordPress comes ready to easily handle custom templates for your page layouts. Templates are a great way to easily manage layouts at scale. Templates & Custom Post Types combined with ACF data are an extremely powerful and flexible way to create and manage custom content on your WordPress powered wesbite.
Page Templates | Official Wordpress Documentation
Here is the basic code that you need to get started creating your own custom template. You will likely want to copy the page content from your theme's page.php or index.php file to use as a starting point.
Here is a small collection of powerful WordPress tools to help speed up and enhance your development experience.
WordPress comes with the ability to automatically store post revisions so that you have a complete timeline of edits for every post/page on your website. This can lead to massive bloat in your database over time. By default WordPress does not impose a limit on the number of revisions that your website will store, but you can set a custom limit with the following function.
define( 'WP_POST_REVISIONS', 2 ); // Set the number of post revisions to 2
define( 'WP_POST_REVISIONS', false ); // Disable post revisions
WordPress provides an autosave feature by default to ensure that you don't lose any/much content in the case of a technical incident. By default, WordPress will autosave a post/page every 60 seconds, you can control when this happens with the following function.
version: '3.7' | |
services: | |
wp_db: | |
image: mysql:5.7 | |
volumes: | |
- ./db_data/:/var/lib/mysql | |
restart: always | |
environment: | |
MYSQL_ROOT_PASSWORD: hallpass | |
MYSQL_DATABASE: hallpass |
lamp : | |
# Update the machine | |
sudo apt update | |
sudo apt upgrade -y | |
# Install Apache | |
sudo apt install apache2 -y |
The instructions below are a basic skeleton for creating a get started style guide for your wordpress repository. Feel free to use this as a base for your project, adding custom content as you need for your project.
Use the following as a guide on how to get started setting up your new development environment.