Skip to content

Instantly share code, notes, and snippets.

View j-mccarthy's full-sized avatar
💭
passing by

John McCarthy j-mccarthy

💭
passing by
  • flowethic
  • United Kingdom
View GitHub Profile
<?php // Remove when using this snippet
function child_load_google_fonts() {
// Setup font arguments
$query_args = array(
'family' => 'Lato:300,400,500,700', // Notice the new 400 weight!!!
);
// A safe way to register a CSS style file for later use
wp_register_style( 'google-fonts', add_query_arg( $query_args, "//fonts.googleapis.com/css" ), array(), null );
<?php // Remove the php tags
// load google webmaster meta
add_action( 'genesis_meta', 'load_google_webmaster_meta' );
function load_google_webmaster_meta() {
echo '<meta name="google-site-verification" content="aLw0qe25ZRJ0KxTWg48j-e2qC6f8927yGq5LBUvP9co" />';
}
@j-mccarthy
j-mccarthy / get_tax_meta.php
Created February 12, 2015 19:37
Tax meta class - repeater field
<?php
// Fields set-up
$repeater_fields[] = $camplight_event_meta->addText('event_info',array('name'=> 'Event specific info points '),true);
$my_meta->addRepeaterBlock('event_info_re_',array('inline' => true, 'name' => 'Repeater Block ','fields' => $repeater_fields));
// Front end template
$repeater_array = get_tax_meta( $not_sure_what_this_is, 'event_info_re_', true);
foreach($repeater_array as $arr) {
<?php
/**
* Source Genesis Child Theme
*
* @package Source
* @since 0.0.1
* @copyright Copyright (c) 2014, Contributors to the Source project
* @license GPL-2.0+
*/
@j-mccarthy
j-mccarthy / register_cmb2_metabox_after_title.php
Last active December 15, 2017 02:27
register cmb2 metabox after title on admin page edit screen
<?php
add_action( 'cmb2_init', 'source_banner_metabox' );
function source_banner_metabox() {
$prefix = '_source_demo_';
$cmb_demo = new_cmb2_box( array(
'id' => $prefix . 'metabox',
/** MailChimp for WordPress */
.mc4wp-form-fields {
max-width: 690px;
margin: 0 auto;
}
.mc4wp-form-fields label {
margin-right: 1em;
margin-left: 1em;
color: #fff;
}
/* Good Reviews */
/** Home page column layout - To be worked on */
.homepage-testimonial-wrap {
background-color: #f1f4f0;
padding-top: 3em;
margin-top: 4em;
}
.widget_grfwp_widget_reviews h2 {
text-align: center;
}
<?php
/**
* Customizer handler.
*
* @package jmccarthy\modularTheme\Customizer;
* @since 1.0.0
* @author jmccarthy
*
*/
namespace jmccarthy\modularTheme\Customizer;
/**
* Query used to pull in post data for custom data array
*/
function get_all_events() {
$args = array(
// Type & Status Parameters
'post_type' => 'event',
'post_status' => 'published',
<?php
/**
* Template section where the event posts are displayed.
*/
?>
<aside class="events--filter">
<?php echo facetwp_display( 'facet', 'audience' ); ?>
</aside>