Categories
PHP

PHP Errors

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

Quick and dirty – add this to your PHP file to show all errors instead of server error 500 message

Categories
WordPress

WordPress – Child Templates

It’s been a while since I’ve done anything in WordPress, and I wanted to customise the 2020 theme. Which seems nice

To make a child theme, you need to start with 3 things:

  • A new directory
  • functions.php
  • style.css

Directory

Add a new directory – named your theme name, in the path:

wp-content/themes/

New directory

functions.php

Create a new file in this directory called functions.php and add the following code to inherit all the styles from the parent theme

<?php
//* Code goes here

add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' );

function enqueue_parent_styles() {
   wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
}

style.css

Create a new file in this directory called style.css and paste the following code – I don’t know the bare minimum that’s needed to mark it as a theme – but change the information from Your Name to … well

/*
Theme Name: Your Name
Theme URI: https://terryprobert.co.uk/theme
description: Your Description
Author: You
Author URI: https://terryprobert.co.uk/
Template: twentytwenty
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
Text Domain: twenty-twenty-child
*/

Rock and Roll

Choose your theme from the Appearance ›› Themes in WordPress, you’ve now made your own child theme!

Theme Details

Overriding templates, customising CSS comes next.

Bare in mind – the theme that’s been created requires the parent theme to be installed. WordPress’s 2020 theme is pretty solid.

WordPress version: 5.3.2

Categories
Uncategorized

2020

It’s about time I started using WordPress for what it’s all about, why I pay for the domain and the hosting every month and the main reason why I made the site in the first place … for blogging.

Maybe one of the reason’s why I haven’t is because of the invention of social media: Facebook, Twitter, Imgur, Myspace (rip); before all of those came about, everyone and their Nan had their own website to share stuff and it seemed like it it was mess!

There’s so many different interests I’ve (ha), so many different thoughts running around my head and this will give me a chance to start to organise them.

I guess it will be nice to look back at some point, and think why didn’t I do this back in the early 00’s?