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' ); |
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 |
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; |
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> |
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; | |
} |
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 { |
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> |
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' ); |
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 ); |
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'); |