Skip to content

Instantly share code, notes, and snippets.

Victor M. Font Jr. vfontjr

View GitHub Profile
@vfontjr
vfontjr / collapsible-section-after.html
Last active Apr 25, 2019
Add Keyboard Accessibility to Formidable Forms Collapsible Sections
View collapsible-section-after.html
<div id="frm_field_[id]_container" class="frm_form_field frm_section_heading form-field[error_class]">
<h3 class="frm_pos_[label_position][collapse_class]" tabindex="0">[field_name]</h3>
[if description]<div class="frm_description">[description]</div>[/if description]
[collapse_this]
</div>
View ajaxComplete-reinit-code.js
/* initialize the repeater for every added row */
$( document ).ajaxComplete( function( event, xhr, settings ) {
var complete_event = jQuery.makeArray(event);
var active_elem = complete_event[0]['target']['activeElement']['dataset']['parent'],
repeater_section = [active_elem];
if (active_elem == '511') {
repeater_row_init( repeater_section );
@vfontjr
vfontjr / acf_blocks.php
Last active Apr 16, 2019
Source Code for Custom Gutenberg Blocks w/ Advanced Custom Fields Blocks Feature
View acf_blocks.php
<?php
/* ACF Blocks requires ACF Pro Ver. 5.8 or higher */
/* save this file to /lib/ directory in your child theme folder */
/* if the directory doesn't exist, create it */
function vfcg_register_blocks() {
if( ! function_exists('acf_register_block') )
return;
acf_register_block( array(
@vfontjr
vfontjr / genesis_seo_title_url_change.php
Created Jan 31, 2019
Change URL in Genesis Framework SEO Title
View genesis_seo_title_url_change.php
<?php
add_filter( 'genesis_seo_title', 'child_header_title', 10, 3 );
function child_header_title( $title, $inside, $wrap ) {
$inside = sprintf( '<a href="https://example.com/" title="%s">%s</a>', esc_attr( get_bloginfo( 'name' ) ), get_bloginfo( 'name' ) );
return sprintf( '<%1$s class="site-title">%2$s</%1$s>', $wrap, $inside );;
}
View create-thank-you-form-entries.php
<?php
/*
Function Name: Create Thank You form Entries
Description: Creates one entry in Thank You form for each winner recorded in repeatable field section of invoice form.
Version: 1.0
Author: Victor M. Font Jr.
Author URI: https://victorfont.com/
*/
/* add the action at a higher priority than 41 so it executes after Zaperi add-on */
@vfontjr
vfontjr / gutenberg-color-palette.php
Created Dec 17, 2018
Change the Gutenberg Color Palette
View gutenberg-color-palette.php
<?php
add_action( 'after_setup_theme', 'vmf_gutenberg_color_palette' );
function vmf_gutenberg_color_palette() {
add_theme_support(
'editor-color-palette', array(
array(
'name' => esc_html__( 'Pale pink', '@@textdomain' ),
'slug' => 'pale-pink',
'color' => '#f78da7',
View debug_pending_updates.php
<?php
/* To see this output, add ?debug_updates to the site url and refresh the page */
function debug_pending_updates() {
// Rough safety nets
if ( ! is_user_logged_in() || ! current_user_can( 'manage_options' ) ) return;
if ( ! isset( $_GET['debug_updates'] ) ) return;
$output = "";
@vfontjr
vfontjr / retrieve_post_id.php
Last active Dec 14, 2018
Formidable Pro: Retrieve Post ID and add to meta data
View retrieve_post_id.php
<?php
add_action('frm_after_create_entry', 'after_entry_created', 30, 2);
function after_entry_created($entry_id, $form_id) {
global $wpdb;
if ( $form_id == 2 ) {
$table_name = $wpdb->prefix . 'frm_items';
$post_id = $wpdb->get_var( "SELECT post_id FROM " . $table_name . " where id = " . $entry_id );
FrmEntryMeta::add_entry_meta( $entry_id, 131, "", $post_id); //change 131 to the ID of the field in which you want to store the entry ID
}
@vfontjr
vfontjr / alignfull-alignwide.css
Last active Mar 16, 2019
Adustments to Genesis CSS for Gutenberg
View alignfull-alignwide.css
.entry-content .alignfull,
.entry-content .alignwide {
margin-left : calc( -100vw / 2 + 100% / 2 );
margin-right : calc( -100vw / 2 + 100% / 2 );
max-width : 100vw;
}
@vfontjr
vfontjr / Genesis-Category-Outro-Text.php
Last active Dec 14, 2018
Add Outro text to category pages in Genesis
View Genesis-Category-Outro-Text.php
<?php
add_action( "genesis_after_loop", "display_category_outro");
function display_category_outro() {
if ( is_category() ) {
echo "test message for outro";
}
}
You can’t perform that action at this time.