View add-gtag-wordpress-header
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
// Add Google Analytics to <head> | |
function add_google_analytics_to_head() { | |
// Paste the whole google tracking tag (gtag.js) here. | |
} | |
add_action( 'wp_head', 'add_google_analytics_to_head' ); |
View add-reusable-blocks-wp-admin.php
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 | |
// Add Reusable blocks to WordPress Admin area | |
function add_reusable_blocks_admin_menu() { | |
add_menu_page( 'Reusable Blocks', | |
'Reusable Blocks', | |
'edit_posts', | |
'edit.php?post_type=wp_block', | |
'', | |
'dashicons-editor-table', | |
22 |
View basic-css-header-example.css
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
/* This is for the id */ | |
#article-header { | |
background-color: #0000ff; | |
width: 100%; | |
padding: 20px; | |
} | |
/* This is for the class */ | |
.article-title { | |
font-color: #ffffff; | |
font-size: 18px; |
View basic-html-header-example.html
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
<!doctype html> | |
<html> | |
<title>Page Title</title> | |
<body> | |
<div id="article-header"> | |
<h1 class="article-title">Article Title</h1> | |
</div> | |
</body> | |
</html> |
View header-css-example.css
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
h1{ | |
color: #0000ff; | |
font-size: 18px; | |
} |
View html-id-class-example.html
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
<!doctype> | |
<html> | |
<head> | |
<title>Example of Element id & class attributes</title> | |
<style> | |
#main-heading { | |
font-size: 35px; | |
color: blue; | |
} | |
.my-first-paragraph { |
View basic-html-doc-example.html
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
<!doctype html> | |
<html> | |
<head> | |
<title>Page Title</title> | |
</head> | |
<body> | |
<h1>My First Page Heading</h1> | |
<p>My first paragragh</p> | |
</body> | |
</html> |
View load-custom-script.php
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 | |
function load_custom_script(){ | |
wp_register_script( 'custom-js', custom.js', false ); | |
wp_enqueue_script( 'custom-js' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'load_custom_script' ); |
View wordpress-filter-example.php
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 | |
function custom_excerpt_length( $length ) { | |
return 20; | |
} | |
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); |
View wordpress-action-example.php
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 | |
function custom_copyright_notice() { | |
echo "Copyright © All Rights Reserved"; | |
} | |
add_action('wp_footer','custom_copyright_notice'); |