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>Headline 1</h1> | |
This is an example of a WordPress post, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many posts as you like in order to share with your readers what is on your mind. | |
<h2>Headline 2</h2> | |
This is an example of a WordPress post, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many posts as you like in order to share with your readers what is on your mind. | |
<h3>Headline 3</h3> | |
This is an example of a WordPress post, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many posts as you like in order to share with your readers what is on your mind. | |
<h4>Headline 4</h4> | |
This is an example of a WordPress post, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many posts as you like in ord |
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
// Remove WordPress admin bar | |
add_filter('show_admin_bar', '__return_false') |
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
// Adds Google Analytics code to the header | |
function fernan_analytics_code() { ?> | |
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXX-1"></script> | |
<script> | |
window.dataLayer = window.dataLayer || []; | |
function gtag(){dataLayer.push(arguments);} | |
gtag('js', new Date()); | |
gtag('config', 'UA-XXXXXXXX-1'); |
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 | |
/** | |
* | |
* Simple Google Analytics WordPress plugin | |
* | |
* @link https://www.fernan.com.es/ | |
* @since 1.0.0 | |
* | |
* Plugin Name: Fernan Google Analytics |
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
var el = wp.element.createElement, | |
registerBlockType = wp.blocks.registerBlockType, | |
blockStyle = { backgroundColor: '#900', color: '#fff', padding: '20px' }; | |
registerBlockType( 'gutenberg-boilerplate-es5/hello-world-step-01', { | |
title: 'Hello World (Step 1)', | |
icon: 'universal-access-alt', | |
category: 'layout', |
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 | |
/* | |
Enqueuing Block Scripts | |
https://wordpress.org/gutenberg/handbook/blocks/writing-your-first-block-type/ | |
*/ | |
function gutenberg_boilerplate_enqueue_block_editor_assets() { | |
wp_enqueue_script( | |
'gutenberg-boilerplate-es5-step01', | |
plugins_url( 'step-01/block.js', __FILE__ ), | |
array( 'wp-blocks', 'wp-element' ) |
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 | |
// Create menu section under Tools in WordPress admin | |
add_action( 'admin_menu', 'docs_admin_menu' ); | |
// New section under Tools | |
function docs_admin_menu() { | |
add_management_page( 'Docs', 'Docs', 'manage_categories', 'docs', 'content_docs_admin_menu' ); | |
} |
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
// Color Buttons Shortcode - Genesis | |
// Add Shortcode | |
function function_color_button( $atts , $content = null ) { | |
// Attributes | |
$atts = shortcode_atts( | |
array( | |
'link' => '', | |
'color' => '', |
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
// Content Boxes Shortcode - Genesis | |
function function_content_box( $atts , $content = null ) { | |
// Attributes | |
$atts = shortcode_atts( | |
array( | |
'color' => '', | |
), | |
$atts, | |
'content-box' |
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{HTTPS} off | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] | |
RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L] | |
</IfModule> |