Skip to content

Instantly share code, notes, and snippets.

Amy Haywood Dutton ahaywood

Block or report user

Report or block ahaywood

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ahaywood / functions.php
Created Mar 5, 2019
WP - Remove Gutenberg Editor
View functions.php
* Reference:
add_filter('use_block_editor_for_post', '__return_false');
ahaywood / image-and-video.php
Created Nov 9, 2018
Display Image and Video
View image-and-video.php
<div class="fitvids">
<?php $video = get_field('testimonial_video');
$image = get_field('testimonial_image'); ?>
<?php if ($image && $video) { // image click to video ?>
<a href="#" class="js-video">
<img src="<?php echo $image; ?>" data-video="<?php echo $video; ?>">
<?php } else if ($video) { // video only ?>
ahaywood /
Last active Nov 7, 2018
JS: Scroll to Top


Make sure you're including jQuery within the project.

Quick Use

The link that you want the user to click, trigger the scroll, needs to have a class of js-scroll-to-top:

<a href="#" class="js-scroll-to-top">Back to Top</a>

At the top of your page, right after the body tag, include an empty div with an ID of top:

ahaywood / comments.php
Created Nov 9, 2017
PHP - WP: Ah Ha Comments
View comments.php
<?php wp_list_comments(array(
'avatar_size' => '140',
'type' => 'comment',
'callback' => 'ahha_comments'
)); ?>
ahaywood / page.php
Created Nov 7, 2017
WP: Three ways to display an image
View page.php
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php // ACF
$image = get_field('extra_image');
<img src="<?= $image['url']; ?>" alt="<?= $image['alt']; ?>">
View html-share-buttons.html
<!-- I got these buttons from -->
<div id="share-buttons">
<!-- Buffer -->
<a href=";text=Simple Share Buttons" target="_blank">
<img src="" alt="Buffer" />
<!-- Digg -->
<a href="" target="_blank">
View .gitmodules
[submodule "wp"]
path = wp
url = git://
[submodule "ahha_plugin_acf"]
path = wp-content/plugins/ahha_plugin_acf
url =
[submodule "ahha_plugin_wpdbmigratepro"]
path = wp-content/plugins/ahha_plugin_wpdbmigratepro
ahaywood / _colors.scss
Created Mar 23, 2017
Creating a color scheme
View _colors.scss
// Scheme of colors
$colorscheme: (
  gray: (
    base: #ccc,
    light: #f2f2f2,
    dark: #666
  brown: (
    base: #ab906b,
    light: #ecdac3,
ahaywood / _buttons.scss
Last active Mar 23, 2017
Button Colors
View _buttons.scss
$buttons: (success, green, white),
(warning, yellow, black),
(danger, red, white);
/* For each key in the map, created an own class */
@each $name, $background, $text in buttons {
  .button--#{$name} {
    background: $background;
color: $text;
ahaywood / _icons.scss
Created Mar 23, 2017
Setting up an icon system - 2 different options. one that establishes the icon with the style, another as a pseudo element.
View _icons.scss
$icons: (
  checkmark: a,
  plus: b,
  minus: c
/* For each key in the map, created an own class */
@each $name, $value in $icons {
  .icon--#{$name} {
    content: $value;
You can’t perform that action at this time.