Skip to content

Instantly share code, notes, and snippets.

View tessak22's full-sized avatar
🚀
#DevTools Growth & Adoption

Tessa Kriesel tessak22

🚀
#DevTools Growth & Adoption
View GitHub Profile
@tessak22
tessak22 / style.css
Last active October 29, 2019 14:21
ACF Team Member Block
/* CSS HERE */
@tessak22
tessak22 / functions.php
Last active February 20, 2020 10:58
ACF Testimonial Block
/**
* Testimonial Block
*/
function register_acf_block_types() {
// register a testimonial block.
acf_register_block_type(array(
'name' => 'testimonial',
'title' => __('Testimonial'),
'description' => __('A custom testimonial block.'),
@tessak22
tessak22 / functions.php
Created March 12, 2019 12:06
Hero Gutenberg Block using Advanced Custom Fields 5.8 Pro
/**
* Register hero block
*/
add_action('acf/init', 'hero');
function hero() {
// check function exists
if( function_exists('acf_register_block') ) {
// register a hero block
@tessak22
tessak22 / functions.php
Created March 12, 2019 11:48
Building Gutenberg Blocks with ACF — Register Block
/**
* Register hero block
*/
add_action('acf/init', 'hero');
function hero() {
// check function exists
if( function_exists('acf_register_block') ) {
// register a hero block
@tessak22
tessak22 / function.php
Last active February 21, 2019 16:56
Hero ACF Block (Requires ACF Pro 5.8)
/**
* Register hero block
*/
add_action('acf/init', 'hero');
function hero() {
// check function exists
if( function_exists('acf_register_block') ) {
// register a hero block
@tessak22
tessak22 / functions.php
Created October 5, 2018 21:07
Options Page for Theme Settings with ACF
/**
* Add ACF Options for Theme Settings
*/
if( function_exists('acf_add_options_page') ) {
acf_add_options_page(array(
'page_title' => 'Theme Settings',
'menu_title' => 'Theme Settings',
'menu_slug' => 'theme-general-settings',
'capability' => 'edit_posts',
@tessak22
tessak22 / page-dogs.php
Created October 5, 2018 18:21
Page template to display my Dogs Custom Post Type
<?php
/**
* Template Name: Dogs
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
* @version 1.0
@tessak22
tessak22 / functions.php
Created October 5, 2018 18:19
Dogs Custom Post Type
// Custom Post Types
add_action('init', 'tessak22_register_custom_post_types', 0);
function tessak22_register_custom_post_types()
{
$arr_custom_post_type_options = array(
/*
array(
'label' => 'lowercase_name' // ** 20 char max, no spaces or caps
'singlar' => 'Human-Readable Item' // singular name
'plural' => 'Human-Readable Items' // plural name
@tessak22
tessak22 / centered_paragraph_with_title.php
Created October 5, 2018 17:42
ACF Page Builder - Blocks - Centered Paragraph with Title (Create a "blocks" directory in your theme directory and place in there)
<?php
$title = get_sub_field('title');
$content = get_sub_field('content');
?>
<section class="content-block centered_paragraph_with_title flex">
<div class="content col-sm-10 col-sm-offset-1 text-center">
<?php if ( $title ): ?>
<h3><?php echo $title; ?></h3>
@tessak22
tessak22 / page.php
Created October 5, 2018 17:38
ACF Page Builder - Add to template file
<?php //each page builder has its own section
get_template_part('inc', 'page-builder');
?>