Skip to content

Instantly share code, notes, and snippets.

View bdeleasa's full-sized avatar

Brianna Deleasa bdeleasa

View GitHub Profile
@bdeleasa
bdeleasa / the-events-calendar-disable-json.php
Created September 28, 2018 13:42
Disables the default JSON outputted by the Events Calendar plugin.
<?php
/**
* The plugin bootstrap file
*
* This file is read by WordPress to generate the plugin information in the plugin
* admin area. This file also includes all of the dependencies used by the plugin,
* registers the activation and deactivation functions, and defines a function
* that starts the plugin.
*
* @link http://briannadeleasa.com
@bdeleasa
bdeleasa / cmtoinches.cpp
Last active September 23, 2018 22:37
A c++ app for converting CM to inches. Helping a friend out by getting it partially working for his homework. :)
#include <iostream>
using namespace std;
int main( int argc, char *argv[] ) {
string firstArg = "";
char * secondArg;
// Warning if no arguments are found
@bdeleasa
bdeleasa / .htaccess
Created August 14, 2018 16:12
Wordpress .htaccess with browser caching and compression
<IfModule mod_mime.c>
AddType application/vnd.ms-fontobject .eot
AddType application/x-font-opentype .otf
AddType image/svg+xml .svg
AddType application/x-font-ttf .ttf
AddType application/font-woff .woff
AddType application/font-woff2 .woff2
</IfModule>
<IfModule mod_deflate.c>
@bdeleasa
bdeleasa / wp-fix-featured-images.php
Created July 9, 2018 14:46
Makes sure all posts have a featured image. Updates older posts and sets the first embedded image as the featured image. Also does the same for any new posts created.
@bdeleasa
bdeleasa / the-events-calendar-show-all-events.php
Created July 7, 2018 17:14
Modifies The Events Calendar plugin event archive to include both present and past events. Also reorders the events so they are in revers chronological order.
<?php
/**
* The plugin bootstrap file
*
* This file is read by WordPress to generate the plugin information in the plugin
* admin area. This file also includes all of the dependencies used by the plugin,
* registers the activation and deactivation functions, and defines a function
* that starts the plugin.
*
* @link http://example.com
@bdeleasa
bdeleasa / woocommerce-private-shop.php
Created July 7, 2018 17:11
Wordpress plugin that redirects any non-logged-in users to the home page if they try to access any portion of WooCommerce.
<?php
/**
* The plugin bootstrap file
*
* This file is read by WordPress to generate the plugin information in the plugin
* admin area. This file also includes all of the dependencies used by the plugin,
* registers the activation and deactivation functions, and defines a function
* that starts the plugin.
*
* @link http://example.com
@bdeleasa
bdeleasa / wordpress-dequeue-strong-testimonials-styles.php
Last active February 9, 2018 18:08
Dequeues the custom styling provided by Strong Testimonials.
<?php
add_filter( 'wp_enqueue_scripts', 'THEMENAME_dequeue_strong_testimonials_styles', 40 );
/**
* Dequeues the custom styling provided by Strong Testimonials.
*
* We're styling the testimonials ourselves, so we don't need their styles.
*
* @since 1.0.0
*
@bdeleasa
bdeleasa / wordpress-dequeue-sk-testimonials-styles.php
Created May 22, 2017 20:45
Dequeues the stylesheet outputted by the SK Testimonials plugin.
<?php
add_action( 'wp_enqueue_scripts', 'THEMENAME_dequeue_sk_testimonials_styles', 999 );
/**
* Dequeue the SK Testimonials default stylesheet.
*
* @param none
* @return none
*/
function THEMENAME_dequeue_sk_testimonials_styles() {
@bdeleasa
bdeleasa / wordpress-seo-og-image-fix.php
Created March 20, 2017 17:02
Wordpress plugin that outputs og:image:width and og:image:height tags because Facebook needs them when sharing URLs for the first time.
<?php
/**
* The plugin bootstrap file
*
* This file is read by WordPress to generate the plugin information in the plugin
* admin area. This file also includes all of the dependencies used by the plugin,
* registers the activation and deactivation functions, and defines a function
* that starts the plugin.
*
* @link http://example.com
@bdeleasa
bdeleasa / wp-adjacent-post-nav-orderby-menu-order.php
Created February 21, 2017 14:55
Orders the Wordpress post navigation links by menu order instead of date.
<?php
add_filter( 'get_next_post_where', 'PLUGINNAME_adjacent_post_where' );
add_filter( 'get_previous_post_where', 'PLUGINNAME_adjacent_post_where' );
/**
* Overrides the post navigation to sort by menu order.
*
* @since 1.0.0
*
* @param $sql
* @return mixed