This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Grab the first paragraph, show it where you need it, then take the rest of the content and remove the first paragraph and show it elsewhere | |
// The script uses WordPress functions/content but can be used in any PHP script, just replace the WP functions | |
// First Paragraph | |
global $post; | |
$p1 = wpautop( $post->post_content ); | |
$p1 = substr( $p1, 0, strpos( $p1, '</p>' ) + 4 ); | |
//$p1 = strip_tags($p1, '<a><strong><em><h3><h2><i>'); // in case you need to remove some tags, add the ones you want to KEEP here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Search across all network blogs with elasticpress | |
* | |
* @param $scope string Search scope | |
* | |
* @return string | |
*/ | |
function motivast_ep_search_scope( $scope ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE> | |
<html> | |
<head> | |
<style> | |
#calendar{ | |
width: 336px; | |
display: inline-block; | |
background-color: #000; | |
border: 1px solid #000; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#slider { | |
margin: 2em auto; | |
width: 960px; | |
overflow: hidden; | |
} | |
#slider-wrapper { | |
width: 9999px; | |
height: 300px; | |
position: relative; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( !function_exists( 'populate_roles' ) ) { | |
require_once( ABSPATH . 'wp-admin/includes/schema.php' ); | |
} | |
populate_roles(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install gulp --save-dev | |
npm install browser-sync --save-dev | |
npm install gulp-autoprefixer --save-dev | |
npm install gulp-changed --save-dev | |
npm install gulp-combine-media-queries --save-dev | |
npm install gulp-concat --save-dev | |
npm install gulp-debug --save-dev | |
npm install gulp-filter --save-dev | |
npm install gulp-header --save-dev | |
npm install gulp-newer --save-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> | |
<script> | |
jQuery(document).ready(function($) { | |
$.getJSON("http://sites.lorainccc.edu/mylccc/wp-json/wp/v2/posts/?filter[category_name]=mycampus", function (data) { | |
$.each(data, function( index ){ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Code adapted from https://www.smashingmagazine.com/2011/10/create-custom-post-meta-boxes-wordpress | |
* Created May 2016. | |
* | |
*/ | |
/* Fire our meta box setup function on the post editor screen. */ | |
add_action( 'load-post.php', 'lc_emailer_post_meta_boxes_setup' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var project = 'twentyfifteen_child', | |
parentTheme = 'twentyfifteen', | |
gulp = require('gulp'), | |
sass = require('gulp-sass'), | |
notify = require('gulp-notify'), | |
header = require('gulp-header'), | |
plumber = require('gulp-plumber'); | |
gulp.task('sass', function () { | |
return gulp.src('./themes/' + project + '/scss/style.scss') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_event_template($single_template) { | |
global $post; | |
if ($post->post_type == 'event') { | |
return dirname( __FILE__ ) . '/single-event.php'; | |
return $single_template; | |
} | |
add_filter( "single_template", "my_event_template" ) ; |