Skip to content

Instantly share code, notes, and snippets.

@aikusuma
aikusuma / functions.php
Created February 3, 2019 17:50
Adding Onesignal To Functions.php WordPress
add_filter('onesignal_send_notification', 'onesignal_send_notification_filter', 10, 4);
function onesignal_send_notification_filter($fields,
$new_status, $old_status, $post) {
$fields['data'] = array(
"id" => $post->ID,
"category" => "pemberitahuan",
"silent" => false,
);
$fields['isAndroid'] = true;
@aikusuma
aikusuma / wordpress-json-cheatsheet.md
Created June 27, 2018 20:35 — forked from verticalgrain/wordpress-json-cheatsheet.md
Wordpress JSON API Cheat Sheet

Get posts from one category:

http://www.mixmeals.com/wp-json/wp/v2/categories/1

Get posts from one category by slug:

http://www.mixmeals.com/wp-json/wp/v2/categories?slug=lunch

Get posts from multiple categories by slug or id:

@aikusuma
aikusuma / functions.php
Last active August 29, 2015 14:21
WOW JS for Wordpress
<?php
//* Nambahin animate & Wow.js
add_action( 'wp_enqueue_scripts', 'sk_enqueue_scripts' );
function sk_enqueue_scripts() {
wp_enqueue_style( 'animate', get_stylesheet_directory_uri() . '/css/animate.min.css' ); //* Ubah letak animate.min.css kamu simpan
wp_enqueue_script( 'wow', get_stylesheet_directory_uri() . '/js/wow.min.js', array(), '', true ); //* Ubah letak wow.min.css kamu simpan
}
//* aktifasi WOW.js
add_action('wp_enqueue_scripts', 'sk_wow_init_in_footer');
function sk_wow_init_in_footer() {
@aikusuma
aikusuma / SmoothScroll v0.9.9
Created May 23, 2015 04:11
Smoth Scrolling Mouse
// SmoothScroll v0.9.9
// Licensed under the terms of the MIT license.
// People involved
// - Balazs Galambosi: maintainer (CHANGELOG.txt)
// - Patrick Brunner (patrickb1991@gmail.com)
// - Michael Herf: ssc_pulse Algorithm
function ssc_init(){if(!document.body)return;var e=document.body;var t=document.documentElement;var n=window.innerHeight;var r=e.scrollHeight;ssc_root=document.compatMode.indexOf("CSS")>=0?t:e;ssc_activeElement=e;ssc_initdone=true;if(top!=self){ssc_frame=true}else if(r>n&&(e.offsetHeight<=n||t.offsetHeight<=n)){ssc_root.style.height="auto";if(ssc_root.offsetHeight<=n){var i=document.createElement("div");i.style.clear="both";e.appendChild(i)}}if(!ssc_fixedback){e.style.backgroundAttachment="scroll";t.style.backgroundAttachment="scroll"}if(ssc_keyboardsupport){ssc_addEvent("keydown",ssc_keydown)}}function ssc_scrollArray(e,t,n,r){r||(r=1e3);ssc_directionCheck(t,n);ssc_que.push({x:t,y:n,lastX:t<0?.99:-.99,lastY:n<0?.99:-.99,start:+(new Date)});if(ssc_pending){return}var i=function(){var s=