Skip to content

Instantly share code, notes, and snippets.

View gravnetic's full-sized avatar

Jake Hawkes gravnetic

View GitHub Profile
Disable the WordPress Admin Bar for all Users and Visitors
Turn off the toolbar with one simple line.
view plain
/*
* Disable the WordPress Admin Bar for all Users and Visitors
*/
remove_action( 'init', '_wp_admin_bar_init' );
^ top
Enable the WordPress Admin Bar for admins only
@gravnetic
gravnetic / HTML Embed Code
Last active May 8, 2024 23:47
MMHPI Florida Data Dashboard
<div style="padding-bottom:56.25%; position:relative; display:block; width: 100%">
<iframe width="100%" height="100%"
src="https://data2.mmhpi.org/Florida-Chamber-Behavioral-Health-Dashboard-FLC-BHD.html"
frameborder="0" allowfullscreen="" style="position:absolute; top:0; left: 0">
</iframe>
</div>
<?php
/* Ajax Load events */
function wp_load_events(){
$count = $_POST['count'];
$limit = 10 + $count;
$postsC = array(
'post_type' => 'event',
'post_status'=> 'publish',
'posts_per_page' => -1,
'meta_query' => array(
@gravnetic
gravnetic / gist:b3ef2225fc4c6cd33191dc681dcaeff2
Created February 3, 2022 18:35
Register CPTs and Taxonomy
<?php
//Posts priority area category
add_action( 'init', 'create_prioritycat' );
function create_prioritycat(){
register_taxonomy( 'priority-cat', [ 'post' ], [
'label' => '',
'labels' => [
'name' => 'Priority areas',
'singular_name' => 'Priority area',
<?php
/**
* Template Name: AllStaff page
*/
get_header(); the_post();
?>
<div class="hero-flex wow fadeIn" data-wow-duration="0.8s" data-wow-delay="0.1s" >
<div class="inner">
<div class="hero-flex-inner wow fadeInLeft" data-wow-duration="0.8s" data-wow-delay="0.2s">
<div class="inner-min">
@gravnetic
gravnetic / Blocksy Icon Switch
Created September 17, 2021 15:07
Change Blocksy Icons
add_filter('blocksy:social-box:dynamic-social-networks', function ($networks) {
$networks[] = [
'id' => 'zillow',
'name' => __('Zillow', 'blocksy'),
'icon' => ' <svg
width="20px"
height="20px"
viewBox="0 0 20 20">
<path d="M15.1,6.6c0.1,0,0.2,0,0.2,0.1c0.4,0.4,1.6,1.9,2,2.4c0,0.1,0,0.1,0,0.2c0,0,0,0,0,0c-2.5,2-4.8,4.2-6.8,6.7c0,0,0,0,0,0
c2.7-1.2,9-3,11.9-3.5V8.8L11.2,0L0,8.8v4C3.5,10.7,11.5,7.5,15.1,6.6L15.1,6.6z"/>
/* Typography */
html {
font-size: 62.5%; /* 10px browser default */
}
/* Chrome fix */
body > div {
font-size: 2.0rem;
}
@gravnetic
gravnetic / functions.php
Created September 22, 2020 14:04
Full functions.php prior to roll back...
<?php
/**
* Astra Child Theme functions and definitions (Sabrina Zeidan updates)
*/
//add_action( 'wp_footer', 'alt_sourcebook_footer' );
function alt_sourcebook_footer() {
?>
<script type="text/javascript">
jQuery(document).ready(function ($) {
/*
function sz_artists_per_page_sourcebook( $query) {
global $post;
//if ( !is_admin() && ($query->get('post_type')== 'artist') && (39667 == $post->post_parent) ) {
if ( !is_admin()) {
$query->set( 'posts_per_page', 5 );
}
}
add_action( 'pre_get_posts', 'sz_artists_per_page_sourcebook');
<?php
/**
* Remove [Yoast SEO] HTML Comments
* @link //gist.github.com/llgruff/a7ab776167aa0ed307ec445df54e5fdb
* @link //gist.github.com/paulcollett/4c81c4f6eb85334ba076
*/
if (defined('WPSEO_VERSION')) {
add_action('get_header', function() {
ob_start(
function($o) {