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
/** | |
* Unhook all action with some exception on wp_head and wp_footer | |
*/ | |
function fr_unhook_wp_head_footer(){ | |
global $wp_filter; // Where all the hooks and their actions are stored | |
// Actions that should not be removed from the wp_head hook | |
$wp_head_whitelist = array( 'wp_enqueue_scripts', 'wp_print_styles', 'wp_print_head_scripts' ); | |
// Unhook actions from wp_head |
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
/** | |
* Route single page to custom template | |
* | |
* @return string of path | |
*/ | |
function fr_route_template( $single_template ){ | |
// Put any conditional tag here. This one assumes you want to serve custom template for CPT titled "newsletter"'s single page | |
if( is_singular( 'newsletter' ) ){ |
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
/** | |
* Assuming you want 8 latest posts and excluding sticky posts | |
*/ | |
$posts_args = array( | |
'ignore_sticky_posts' => true, | |
'posts_per_page' => 8 | |
); | |
$posts = new WP_Query( $posts_args ); |
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
/* | |
* -------------------------------------------------------------------------------------------------------------------------------- | |
* CUSTOM META BOXES FOR EASIER CONTENT EDITING | |
* -------------------------------------------------------------------------------------------------------------------------------- | |
*/ | |
add_action( 'add_meta_boxes', 'wp_meta_boxes_add' ); | |
function wp_meta_boxes_add(){ | |
// Custom Meta Boxes for post-type post | |
add_meta_box( 'binus-meta-boxes', 'BINUS Meta Information', 'wp_meta_boxes', 'post', 'normal', 'high' ); | |
} |
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
'use strict'; | |
module.exports = function(grunt){ | |
// load all tasks | |
require('load-grunt-tasks')(grunt, {scope: 'devDependencies'}); | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
makepot: { | |
target: { |
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
'use strict'; | |
module.exports = function(grunt){ | |
// load all tasks | |
require('load-grunt-tasks')(grunt, {scope: 'devDependencies'}); | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
makepot: { | |
target: { |
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
jQuery(document).ready(function($){ | |
/** | |
* Ajaxify Comment Submission | |
* Assuming that comment form's ID is #commentform. Adjust it as you see fit | |
*/ | |
$('body').on('submit', '#commentform', function(e){ | |
// Stop the default form behavior | |
e.preventDefault(); | |
var commentform = $(this); |
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
/** | |
* Adding processing message at comment form | |
* Use inline style so we don't need to load more file | |
*/ | |
function simple_ajax_comment_form_mod( $settings ){ | |
printf( '<div id="submitting-comment" style="padding: 15px 20px; text-align: center; display: none;">%s</div>', __( 'Submitting comment...' ) ); | |
} | |
add_action( 'comment_form', 'simple_ajax_comment_form_mod' ); |
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
/** | |
* Load the script | |
* Most of the time, the script will be used at is_singular(). Make this pluggable tho, just in case the single page is displayed as overlay on other page | |
*/ | |
function simple_ajax_comment_script(){ | |
if( apply_filters( 'simple_ajax_comment_is_used', is_singular() ) ){ | |
/** | |
* Load the js script | |
*/ | |
wp_enqueue_script( 'simple-ajax-comment-script', plugin_dir_url( __FILE__ ) . 'js/simple-ajax-comment.js' , array( 'jquery', 'jquery-form' ), '1.0.0' ); |
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
// ---- | |
// Sass (v3.4.11) | |
// Compass (v1.0.3) | |
// ---- | |
$color: #F44336; | |
$darken: darken( $color, 10% ); | |
$lighten: lighten( $color, 10% ); | |
.box{ |
NewerOlder