Skip to content

Instantly share code, notes, and snippets.

View goldhat's full-sized avatar

Joel Milne goldhat

View GitHub Profile
[acf-render name="acfr_demo_image"]
$wordpress_path = "/path/to/my/wordpress/install";
// may not be needed if inside WP and hooking into actions
// activate_plugin() is in plugin.php
require_once( $wordpress_path . "/wp-load.php" );
require_once( $wordpress_path . "/wp-admin/includes/plugin.php");
$plugins = array("cforms", "w3-total-cache", "wordpress-seo");
foreach ($plugins as $plugin){
$plugin_path = $wordpress_path."wp-content/plugins/{$plugin}.php";
@goldhat
goldhat / gist:b76db663f1441f71503290b70fbf23aa
Last active October 13, 2016 15:27
WP Activate Plugin
$plugin_path = 'custom-plugin';
activate_plugin( $plugin_path );
@goldhat
goldhat / acf-render-template-wrapper-class
Created October 2, 2016 00:05
ACF Render Template Wrapper Classes
<div class="acf-template acf-template-text">
@goldhat
goldhat / gist:94e0e782ce8c126b55a78750b80de8d6
Created October 1, 2016 22:47
ACF Render Shortcode Example - minimal
[acf-render name="my-field"]
@goldhat
goldhat / general.txt
Created October 1, 2016 22:42
ACF Render Shortcode General Example
[acf-render name="first_name" post="123" template="text"]
@goldhat
goldhat / text.txt
Last active October 1, 2016 22:42
ACF Render Shortcode Examples
[acf-render name="first_name"]
Basic example rendering a text field value. Field name is "first_name". Default template (text) will be used to render. No label will be shown.
[acf-render name="first_name" label=1]
Default template (text) will be used, Field label will be shown.
[acf-render name="first_name" post="89"]
Load the value of first_name field from post ID 89.
[acf-render name="first_name" template="custom-text"]
@goldhat
goldhat / Template Registry Minimal
Last active May 15, 2016 10:55
ACF Render template registry array examples for the filter acf-render-template-register
'color' => array(
'field_types' => array('color'),
),
@goldhat
goldhat / page_list_template.php
Created January 9, 2014 00:16
Concrete5 Page List template that loads all blocks from the pages in the list and displays them.
defined('C5_EXECUTE') or die("Access Denied.");
$rssUrl = $showRss ? $controller->getRssUrl($b) : '';
$th = Loader::helper('text');
//$ih = Loader::helper('image'); //<--uncomment this line if displaying image attributes (see below)
//$dh = Loader::helper('date'); //<--uncomment this line if displaying dates (see below)
//Note that $nh (navigation helper) is already loaded for us by the controller (for legacy reasons)
?>
<div class="sixteen columns ccm-page-list testimonials">
@goldhat
goldhat / gist:f2cd0e817376d6bcdf16
Last active August 29, 2015 14:19
Catalog Import XML Format
<razor>
<catalogs>
<catalog>
<name>Catalog One</name>
<path>/catalog-one</path>
</catalog>
<catalog>
<name>Catalog Two</name>
<path>/catalog-one/catalog-two</path>
</catalog>