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 | |
/* | |
* WordPress WP_User_Query Transient Array Search | |
* | |
* Purpose: To search array of relevant user fields | |
* stored as an array in a transient | |
* | |
* Example Array: | |
* [userid] => array ( | |
'0' => 'first_name', |
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
/* | |
* For use when you have a custom page to display a custom post type but also need the CPT pulled into search results. | |
* | |
* Includes functions hooked to filters to alter the title, permalink, and excerpt. | |
* Uses switch statements for easily extending to additional custom post types. | |
* | |
*/ | |
<?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
/* Review the following article for more info on getting started with custom components. | |
* @link https://using-remark.gatsbyjs.org/custom-components/ | |
* | |
* Example here demonstrates detecting if a custom component is being used | |
* If so, do not wrap it with a paragraph tag and invalidate DOM nesting | |
*/ | |
import * as React from 'react'; | |
import rehypeReact from 'rehype-react'; |
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
/* | |
* Usage: | |
* <Permalink label={component} slug={demo} /> | |
*/ | |
import * as React from 'react'; | |
import { StaticQuery, graphql } from 'gatsby'; | |
// Mimics function to test for internal v. external links from docs | |
// @link https://www.gatsbyjs.org/docs/gatsby-link/ |
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
/* | |
Project Structure: | |
src/ | |
- sass/ | |
- - style.scss | |
- index.html | |
npm start - copies src files to dist/ and starts Browsersync server at localhost:3000 | |
npm run build - copies files to dist/ and autoprefixes/minifies 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
/** | |
* Required plugins: gatsby-source-filesystem and gatsby-plugin-sharp | |
* | |
* Basic Hook Usage: | |
* | |
* import useImgSrc from '../utils/useImgSrc'; | |
* | |
* const Image = ({src}) => { | |
* const imgSrc = useImgSrc(src); | |
* |
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
import * as React from 'react'; | |
import { useLocation } from '@reach/router'; | |
import queryString from 'query-string'; | |
const getSelectedTheme = (query) => { | |
const fallback = 'light'; | |
if (query) { | |
const queriedTheme = queryString.parse(query); |
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-primary: purple; | |
$color-secondary: blue; | |
$color-support: green; | |
$theme-colors: ( | |
primary: $color-primary, | |
secondary: $color-secondary, | |
support: $color-support | |
); |
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
span { | |
border: 2px dashed currentcolor; | |
border-radius: 4px; | |
min-height: 15vh; | |
padding: 1rem; | |
color: #0178d4; | |
font-size: 3rem; | |
text-align: center; | |
display: flex; | |
justify-content: center; |
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
<form> | |
<fieldset> | |
<legend>Full Name</legend> | |
<div class="form-field"> | |
<label for="firstname">First Name</label> | |
<input type="text" id="firstname" /> | |
</div> | |
<div class="form-field"> | |
<label for="lastname">Last Name</label> | |
<input type="text" id="lastname" /> |
OlderNewer