Skip to content

Instantly share code, notes, and snippets.

View jessedmatlock's full-sized avatar
🏠
Working from home

Jesse Matlock jessedmatlock

🏠
Working from home
View GitHub Profile
@jessedmatlock
jessedmatlock / acf-first-row.php
Created September 17, 2021 18:20 — forked from neilgee/acf-first-row.php
ACF Repeater - Grab First/LAst or Random Single Data Row
<?php
//My ACF Fields for reference
//testimonials - field group
//testimonial - sub-field
//testimonial_header - sub-field
//First Repeater Row in Array
$rows = get_field( 'testimonials', 348 );// grab all rows from page ID
@jessedmatlock
jessedmatlock / breadcrumbs-code-without-plugin.php
Created June 11, 2021 14:23 — forked from techpulsetoday/breadcrumbs-code-without-plugin.php
By adding this to functions.php to display the menu, just use this function to display it wherever you want.
<?php
/*=============================================
BREADCRUMBS
=============================================*/
// to include in functions.php
function the_breadcrumb()
{
$showOnHome = 0; // 1 - show breadcrumbs on the homepage, 0 - don't show
$delimiter = '&raquo;'; // delimiter between crumbs
$home = 'Home'; // text for the 'Home' link
@jessedmatlock
jessedmatlock / gw-gravity-forms-submit-to-access.php
Created April 21, 2021 21:16 — forked from spivurno/gw-gravity-forms-submit-to-access.php
Gravity Wiz // Gravity Forms // Submit to Access
<?php
/**
* Gravity Wiz // Gravity Forms // Submit to Access
*
* Require that a form be submitted before a post or page can be accessed.
*
* @version 1.7
* @author David Smith <david@gravitywiz.com>
* @license GPL-2.0+
* @link https://gravitywiz.com/submit-gravity-form-access-content/
@jessedmatlock
jessedmatlock / gw-gravity-forms-redirect-if-email-exists.php
Created April 21, 2021 17:35 — forked from spivurno/gw-gravity-forms-redirect-if-email-exists.php
Gravity Wiz // Gravity Forms // Redirect if Email Exists
<?php
/**
* Gravity Wiz // Gravity Forms // Redirect if Email Exists
*
* Redirect to a specified URL if the the submitted email address matches an existing user.
*
* Note: Does not work with AJAX-enabled forms.
*
* @version 0.1
* @author David Smith <david@gravitywiz.com>
<?php
/**
* Gravity Wiz // Gravity Forms // User Registration // Skip Registration if Email Exists
*
* If submitted email is already registered, skip registration.
*
* @version 0.4
* @author David Smith <david@gravitywiz.com>
* @license GPL-2.0+
* @link http://gravitywiz.com/
@jessedmatlock
jessedmatlock / wp-child-page-template.php
Created March 26, 2021 13:42 — forked from kisabelle/wp-child-page-template.php
Wordpress Child Page Template
There is no specific template for child pages, but you can do this pretty easily with the get_template_part() function.
First create a file called "content-child.php".
Second create a file called "content.php".
Next, inside of page.php, place this:
<?php
if( $post->post_parent !== 0 ) {
@jessedmatlock
jessedmatlock / acf.php
Created March 26, 2021 13:42 — forked from kisabelle/acf.php
Advanced Custom Fields
/*----------------------------------------------*/
/* Image Field
/*----------------------------------------------*/
/* Return value: Attachment ID */
<?php if(get_field('logo')): ?>
<?php
$attachment_id = get_field('logo');
$size = "vendor-logo"; // (thumbnail, medium, large, full or custom size)
@jessedmatlock
jessedmatlock / acf-pagination.php
Created March 26, 2021 13:07 — forked from icetee/acf-pagination.php
ACF Repeater Field Pagination
<?php
/*
* Paginate Advanced Custom Field repeater
*/
if( get_query_var('page') ) {
$page = get_query_var( 'page' );
} else {
$page = 1;
}
@jessedmatlock
jessedmatlock / Gravity Forms + Bootstrap 4
Created March 22, 2021 17:46 — forked from brianpurkiss/Gravity Forms + Bootstrap 4
Helpful function for adding Bootstrap 4 classes to Gravity Forms fields.
<?php
/**
* Gravity Forms Bootstrap Styles
*
* Applies bootstrap classes to various common field types.
* Requires Bootstrap to be in use by the theme.
*
* Using this function allows use of Gravity Forms default CSS
* in conjuction with Bootstrap (benefit for fields types such as Address).
*
@jessedmatlock
jessedmatlock / breadcrumbs-functions.php
Created March 19, 2021 17:24 — forked from tinotriste/breadcrumbs-functions.php
Wordpress: Breadcrumbs function
<?php
/*=============================================
= BREADCRUMBS =
=============================================*/
// to include in functions.php
function the_breadcrumb() {
$sep = ' > ';