Skip to content

Instantly share code, notes, and snippets.

@raulillana
Created October 6, 2021 01:09
Show Gist options
  • Save raulillana/1b13c7750cef1259f16c09cef859e2ce to your computer and use it in GitHub Desktop.
Save raulillana/1b13c7750cef1259f16c09cef859e2ce to your computer and use it in GitHub Desktop.
Create files in themes from WP Editor
<?php
// add files to child theme
add_action( 'after_setup_theme', function() {
$file = get_stylesheet_directory() . '/footer.php';
touch( $file );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment