Skip to content

Instantly share code, notes, and snippets.

add_filter( 'allowed_block_types_all', 'restrict_blocks');
function restrict_blocks( $allowed_blocks ) {
if ( ! is_super_admin() ) {
$allowed_blocks = array(
'core/block',
'core/image',
'core/gallery',
'core/paragraph',
'core/heading',
<?php
/**
* Template Name: SIS Courses
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package KSAS_Academic_Department
*/
get_header(); ?>
<?php
/**
* Template part for displaying images from Photoshelter
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Flagship_Tailwind
*/
$username = get_field( 'username', 'option' );
<?php
/*
Template Name: SIS Courses (Graduate)
*/
get_header(); ?>
<?php get_template_part( 'template-parts/featured-image' ); ?>
<?php
// Load Zebra Curl
//require_once TEMPLATEPATH . '/library/Zebra_cURL.php';
// the callback function to be executed for each and every
<div class="grid-container">
<div class="grid-x grid-padding-x padding-top">
<?php $curated_content_query = new WP_Query($curated_content);
$count = 0;
if ($curated_content_query->have_posts()) : ?>
<div class="curated-posts grid-x">
<?php
while ($curated_content_query->have_posts()) : $curated_content_query->the_post();
$count++;
if ($count == 1 || $count == 6) :?>
<?php
/**
* Get the page number from the query string
* In production, get this value from WordPress
* @return integer
*/
function getPage()
{
// deafult page number
@ksascomm
ksascomm / search.php
Last active June 11, 2018 18:42
Custom Query Vars + Mindbreeze Pagination
<?php function mindbreeze_query_vars_filter($vars) {
$vars[] = 'q';
return $vars;
}
add_filter( 'query_vars', 'mindbreeze_query_vars_filter' );
// pagination
$page = get_query_var( 'page', 1 );
$site_path = site_url('/search');
if ($body->resultset->prev_avail) :
<?php
function add_opengraph_doctype($output) {
return $output . '
xmlns="https://www.w3.org/1999/xhtml"
xmlns:og="https://ogp.me/ns#"
xmlns:fb="http://www.facebook.com/2008/fbml"';
}
add_filter('language_attributes', 'add_opengraph_doctype');
@ksascomm
ksascomm / directory.js
Last active January 11, 2018 15:57
combination filter with search
jQuery(document).ready( function($) {
// debounce so filtering doesn't happen every millisecond
function debounce( fn, threshold ) {
var timeout;
return function debounced() {
if ( timeout ) {
clearTimeout( timeout );
}
function delayed() {
@ksascomm
ksascomm / courses-undergrad.php
Last active December 12, 2017 19:08
Courses
<?php
/*
Template Name: SIS Courses
*/
get_header(); ?>
<?php // Load Zebra Curl
require_once TEMPLATEPATH . "/library/Zebra_cURL.php";
//Set query sting variables
$theme_option = flagship_sub_get_global_options();