Skip to content

Instantly share code, notes, and snippets.

@smartscrutiny
smartscrutiny / page-GoogleAds.php
Last active March 10, 2019 14:33
This is a simple WordPress page template for showing a list of post titles in a specific category, with a Google ad after a certain number of posts. Add your Google Adsense script in the div with class custom-adsense. Save this file in the same folder in your WordPress theme directory where your page.php file lives, and a new template called "Li…
<?php
/*
Template Name: List of Posts with Google Ads
This is a simple WordPress page template for showing a list of post titles
in a specific category, with a Google ad after a certain number of posts.
Add your Google Adsense script in the div with class custom-adsense. Save this
file in the same folder in your WordPress theme directory where your page.php
file lives, and a new template called "List of Posts with Google Ads"
will be available when you create new pages in WordPress.
@smartscrutiny
smartscrutiny / jquery-change-div-class-dynamically.js
Created March 9, 2019 16:09
Bootstrap's grid handles most browser resize issues beautifully, but I ran into a situation where I really needed a div with a col-md-9 class to change dynamically to a div with a col-md-12 class at certain browser sizes only. I gave these divs an id of #jquery-target. This jQuery snippet did the trick.
/*
------------------------------
Bootstrap's grid handles most browser resize issues beautifully, but I ran into a situation
where I really needed a div with a col-md-9 class to change dynamically to a div with a col-md-12 class at certain
browser sizes only. I gave these divs an id of #jquery-target. This jQuery snippet did the trick.
------------------------------
*/
jQuery(document).ready(function ($) {
@smartscrutiny
smartscrutiny / gravityview-trigger-gform_after_submission-form-20.php
Last active February 28, 2019 22:15 — forked from zackkatz/gravityview-trigger-gform_after_submission-form-12.php
GravityView - Trigger the `gform_after_submission` action when an entry is edited, but ONLY for Form #20.
<?php
/**
* GravityView doesn't trigger the `gform_after_submission` action when editing entries. This does that,
* but ONLY FOR FORM #20.
*
* @param array $form
* @param int $entry_id ID of the entry being updated
* @param GravityView_Edit_Entry_Render $object
*