Skip to content

Instantly share code, notes, and snippets.

View ahaywood's full-sized avatar

Amy Haywood Dutton ahaywood

View GitHub Profile
@ahaywood
ahaywood / README.md
Last active November 7, 2018 21:18
JS: Scroll to Top

Requirements

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
ahaywood / comments.php
Created November 9, 2017 07:42
PHP - WP: Ah Ha Comments
<?php wp_list_comments(array(
'avatar_size' => '140',
'type' => 'comment',
'callback' => 'ahha_comments'
)); ?>
@ahaywood
ahaywood / page.php
Created November 7, 2017 00:46
WP: Three ways to display an image
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php // ACF
$image = get_field('extra_image');
var_dump($image);
?>
<img src="<?= $image['url']; ?>" alt="<?= $image['alt']; ?>">
<?php // FEATURED IMAGE >> IMAGE TAG
@ahaywood
ahaywood / html-share-buttons.html
Created September 21, 2017 16:33 — forked from davidsneal/html-share-buttons.html
HTML Share Buttons
<!-- I got these buttons from simplesharebuttons.com -->
<div id="share-buttons">
<!-- Buffer -->
<a href="https://bufferapp.com/add?url=https://simplesharebuttons.com&amp;text=Simple Share Buttons" target="_blank">
<img src="https://simplesharebuttons.com/images/somacro/buffer.png" alt="Buffer" />
</a>
<!-- Digg -->
<a href="http://www.digg.com/submit?url=https://simplesharebuttons.com" target="_blank">
@ahaywood
ahaywood / .gitmodules
Created June 14, 2017 12:10
.gitmodules
[submodule "wp"]
path = wp
url = git://github.com/WordPress/WordPress.git
[submodule "ahha_plugin_acf"]
path = wp-content/plugins/ahha_plugin_acf
url = git@bitbucket.org:ahhacreative/ahha_plugin_acf.git
[submodule "ahha_plugin_wpdbmigratepro"]
path = wp-content/plugins/ahha_plugin_wpdbmigratepro
@ahaywood
ahaywood / _colors.scss
Created March 23, 2017 15:53
Creating a color scheme
// Scheme of colors
$colorscheme: (
  gray: (
    base: #ccc,
    light: #f2f2f2,
    dark: #666
  ),
  brown: (
    base: #ab906b,
    light: #ecdac3,
@ahaywood
ahaywood / _buttons.scss
Last active March 23, 2017 15:52
Button Colors
$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
ahaywood / _icons.scss
Created March 23, 2017 15:48
Setting up an icon system - 2 different options. one that establishes the icon with the style, another as a pseudo element.
$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;
@ahaywood
ahaywood / _colors.scss
Created March 23, 2017 15:48
iMom Color Maping - Wanted a specific color for each of the blog categories
$category-colors : (imom-morning, $ff-yellow, $gray-8),
(movie-monitor, $ff-coral, white),
(pillow-talk, $ff-l-blue, white),
(susan, $ff-limey-green, white),
(marriage, $ff-red, white),
(family-fun, $ff-orange, white),
(printables, $ff-teal, white),
(mom-life, $ff-blue, white),
(quotes, $ff-purple, white),
(parenting, $ff-green, white);
@ahaywood
ahaywood / _social-media.scss
Created March 23, 2017 15:47
Jen Chooses Joy - random background position for social media icons
/* 5 is the number of list items and the number within $list */
$list: "0 0", "50px 0", "100px 0", "150px 0", "200px 0";
@for $i from 1 through 5 {
li:nth-child(#{$i}) {
$imgKey: random(5);
$nth: nth($list, $imgKey);
background-position: #{$nth};
}
}