Skip to content

Instantly share code, notes, and snippets.

Stefaan5

Block or report user

Report or block Stefaan5

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Stefaan5
Stefaan5 / AMP GA tracking
Created Dec 22, 2016
AMP Google Analytics script voor toe te voegen (aan bv. Yoast).
View AMP GA tracking
<amp-analytics type="googleanalytics" id="analytics1">
<script type="application/json">
{
"vars": {
"account": "UA-XXXXX-Y"
},
"triggers": {
"trackPageview": {
"on": "visible",
"request": "pageview"
View AMP Google Analytics Tracking
add_action( 'amp_post_template_head', 'amp_post_template_add_analytics_js' );
function amp_post_template_add_analytics_js( $amp_template ) {
$post_id = $amp_template->get( 'post_id' );
?>
<script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
<?php
}
add_action( 'amp_post_template_footer', 'xyz_amp_add_analytics' );
function xyz_amp_add_analytics( $amp_template ) {
$post_id = $amp_template->get( 'post_id' );
@Stefaan5
Stefaan5 / Pagination 404 Issue
Created Jul 12, 2016
I am trying to create a paginated loop of testimonials including the title, featured image, excerpt and permalink to the single page. This is a Custom Post Type made with the plugins CPT UI & ACF. Also, the site is made on a local development environment using MAMP. I was able to create the paginated loop using the snippet from Bill Erickson, wh…
View Pagination 404 Issue
//Create Paginated loop for CPT 'getuigenissen'
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action('genesis_loop', 'getuigenissen_loop');
function getuigenissen_loop(){
$args = array(
'posts_per_page' => 1,
'post_type' => 'getuigenissen',
You can’t perform that action at this time.