Skip to content

Instantly share code, notes, and snippets.

Avatar
💙
Cultivating Community @twitterdev

Tessa Kriesel tessak22

💙
Cultivating Community @twitterdev
View GitHub Profile
@tessak22
tessak22 / style.css
Last active Oct 29, 2019
ACF Team Member Block
View style.css
/* CSS HERE */
@tessak22
tessak22 / functions.php
Last active Feb 20, 2020
ACF Testimonial Block
View functions.php
/**
* 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 Mar 12, 2019
Hero Gutenberg Block using Advanced Custom Fields 5.8 Pro
View functions.php
/**
* 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 Mar 12, 2019
Building Gutenberg Blocks with ACF — Register Block
View functions.php
/**
* 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 Feb 21, 2019
Hero ACF Block (Requires ACF Pro 5.8)
View function.php
/**
* 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 Oct 5, 2018
Options Page for Theme Settings with ACF
View functions.php
/**
* 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 Oct 5, 2018
Page template to display my Dogs Custom Post Type
View page-dogs.php
<?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 Oct 5, 2018
Dogs Custom Post Type
View functions.php
// 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 Oct 5, 2018
ACF Page Builder - Blocks - Centered Paragraph with Title (Create a "blocks" directory in your theme directory and place in there)
View centered_paragraph_with_title.php
<?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 Oct 5, 2018
ACF Page Builder - Add to template file
View page.php
<?php //each page builder has its own section
get_template_part('inc', 'page-builder');
?>
You can’t perform that action at this time.