Setup gtm container Add the code to webpage. Setup a Google Analytics property, get the GA Tracking ID Add gtag.js to the webpage before GTM code.
<script async src="https://www.googletagmanager.com/gtag/js?id=######"></script>
// Place this in wp-config | |
define( 'ACF_5_KEY', 'yourkeyhere' ); | |
// Set ACF 5 license key on theme activation. Stick in your functions.php or equivalent. | |
function auto_set_license_keys() { | |
if ( ! get_option( 'acf_pro_license' ) && defined( 'ACF_5_KEY' ) ) { | |
$save = array( | |
'key' => ACF_5_KEY, |
Setup gtm container Add the code to webpage. Setup a Google Analytics property, get the GA Tracking ID Add gtag.js to the webpage before GTM code.
<script async src="https://www.googletagmanager.com/gtag/js?id=######"></script>
<button id="btnExpand" onClick="showMsg();">Click here to see all +</button> | |
<div id="welcomeMsg" class="closed"> | |
<div id="collapse-window" class="standard-window"> | |
<div class="inner-wrapper"> | |
<h5>In 2018, we also helped the following audiences:</h5> | |
<p>Lorum ipsum</p> | |
</ul> | |
</div> |
<?php | |
/** | |
* Get the average pixel colour from the given file using Image Magick | |
* | |
* @param string $filename | |
* @param bool $as_hex Set to true, the function will return the 6 character HEX value of the colour. | |
* If false, an array will be returned with r, g, b components. | |
*/ | |
function get_average_colour($filename, $as_hex_string = true) { |
<?php | |
/////////////////////////////////////////////////////////////////////////////////// | |
// // | |
// This is using a sample local WordPress Install and is not production safe // | |
// It uses the REST and Basic Auth plugins // | |
// // | |
/////////////////////////////////////////////////////////////////////////////////// |
<?php | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
class Skubbs_Post_Types { | |
public static function init() { | |
add_action( 'init', array( __CLASS__, 'register_post_types' ), 5 ); |
<?php | |
/** | |
* single-{category_slug}.php || single-post-type.php || single.php | |
* | |
* Gets post cat slug, post type and look matching single- templates. | |
* If $categories is not empty, get the category slug, and look for single-{$category_slug}.php. If this file doesn't exist then return single.php. | |
* If $categories is empty, then check the post_type. If its not equal to post, then we are using a custom post type. Look for | |
* single-{$post_type}.php. If this file doesn't exist then use single.php. | |
* If $categories is empty and post_type is equal to post then use single.php. | |
* |
<?php | |
function makeImage( $msg, $msg2, $font='./arial.ttf', $fontsize=40, $output='pic1.png') | |
{ | |
$fontcolor = imagecolorallocate($im, 128, 128, 128); | |
echo $msg; | |
echo "<br/>".$msg2; | |
$backgroundImg = imagecreatefromjpeg("logo-usarmy-with-texture-640x360.jpg"); |
<%@ WebHandler Language="C#" Debug="true" Class="name" %> | |
using System.Web; | |
public class name : IHttpHandler { | |
public void ProcessRequest (HttpContext context) { | |
} |
<?php | |
/* Short Title | |
* return a short title with ellipsis if the title is too long | |
* accepts a maxchar value | |
* Usage Example: echo short_title( $maxchar = 100 ); | |
* Place the code inside the loop and set the character limit. If the title is longer than the character limit set, | |
* it will display ellipsis at the end. | |
--------------------------------------------------------------------*/ | |
function short_title( $maxchar = 90 ) { | |