Skip to content

Instantly share code, notes, and snippets.

View webmasterninjay's full-sized avatar
💭
I may be slow to respond.

Jay webmasterninjay

💭
I may be slow to respond.
View GitHub Profile
@webmasterninjay
webmasterninjay / index.html
Created March 25, 2020 18:27
Simple Coming Soon - Underconstruction Template
<!DOCTYPE html>
<html>
<head>
<style>
body, html {
height: 100%;
margin: 0;
}
.bgimg {
@webmasterninjay
webmasterninjay / bp-custom.php
Created January 21, 2020 19:57
Exclude several user roles from buddypress loop
<?php
function exclude_roles_from_members_loop( $retval ) {
if ( bp_is_members_directory() ) {
$exclude_ids = get_users(
array(
'fields' => 'ID',
'role__in' => array( 'editor', 'author' ) // change the roles here
)
);
@webmasterninjay
webmasterninjay / custom.php
Created August 12, 2019 17:01
Add custom image size and display on media size selection.
<?php
// AB Post Grid image thumb
add_image_size( 'ab-blog-thumb', 337, 224, TRUE );
add_filter( 'image_size_names_choose', 'ab_blog_thumb_size' );
function ab_blog_thumb_size( $sizes ) {
return array_merge( $sizes, array(
'ab-blog-thumb' => __( 'AB Grid Thumbnail' ),
) );
@webmasterninjay
webmasterninjay / send_custom_email.php
Created August 6, 2019 17:15 — forked from andrewlimaza/send_custom_email.php
Send a custom email when a user checks out for a pmpro level.
<?php
/**
* Add this code to your PMPro Customizations Plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* This function below sends a custom HTML email to the user that checks out for a pmpro membership level, easily extendible to send to admins, or specific users and so on.
* Website: https://paidmembershipspro.com
*/
//let's send a custom email after user checkouts. This will not send an email if an admin changes user's level inside member area.
function custom_email_after_checkout( $user_id, $morder ){
@webmasterninjay
webmasterninjay / iframe_defer.js
Created February 26, 2019 20:50 — forked from bjmiller121/iframe_defer.js
Defer loading of iframes
/**
* Defer iframe loading.
*
* Markup:
* <div class="defer-iframe" data-src="{SOURCE URL}" data-{ATTR}="{VAL}"></div>
*/
$(window).load( function(){
if ($('.defer-iframe').length) {
$('.defer-iframe').each( function() {
var $iframe = $('<iframe frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>');
jQuery(document).ready(function($) {
$('div.submit input').before("<p class='toc-acceptance'><input type='checkbox' value='1' name='accept_toc' required='required' id='accept_toc' checked> Accept <a href='https://clubdragonfly.com/terms-and-conditions/' target='_blank'>Terms & Conditions</a></p>");
$('div.submit input#accept_toc').click(function () {
$('#signup_submit').attr('disabled',! this.checked);
});
});
@webmasterninjay
webmasterninjay / jessica.php
Created January 16, 2019 15:41
loop-shortcode.php
<?php
function team_member_loop( $atts ) {
ob_start();
$args = array(
'post_type' => 'team-member',
'showposts' => 99,
'order' => 'ASC',
);
$query = new WP_Query( $args );
@webmasterninjay
webmasterninjay / export_csv.php
Created November 14, 2018 15:49 — forked from apocratus/export_csv.php
Export MySQL to CSV (php script)
<?php
/* vars for export */
// database record to be exported
$db_record = 'XXXXXXXXX';
// optional where query
$where = 'WHERE 1 ORDER BY 1';
// filename for export
$csv_filename = 'db_export_'.$db_record.'_'.date('Y-m-d').'.csv';
// database variables
@webmasterninjay
webmasterninjay / remove-yoast-seo-nag.php
Created September 17, 2015 20:46
This plugin remove the annoying Yoast SEO nag in your wordpress dashboard every update.
<?php
/**
* Plugin Name: Remove Yoast SEO Nag
* Plugin URI: https://wordpress.org/
* Description: This plugin remove the annoying Yoast SEO nag in your wordpress dashboard every update.
* Version: 1.0.0
* Author: Jayson Antipuesto
* Author URI: https://wordpress.org/
*/
// The Loop
/*
* Usage: loop category="news" query="" pagination="false"
*/
<?php
add_shortcode("loop", "myLoop");
function myLoop($atts, $content = null) {
extract(shortcode_atts(array(