Skip to content

Instantly share code, notes, and snippets.

@bewho
bewho / definition-lists-with-wp_nav_menu.php
Created May 27, 2018 04:16 — forked from Narga/definition-lists-with-wp_nav_menu.php
Use definition lists with wp_nav_menu
// Secondary Menu is Widgetable
function widget_secondary_navigation() {
$args = array(
'echo' => false,
'items_wrap' => '<dl id="%1$s" class="%2$s myclass">%3$s</dl>','theme_location' => 'secondary_navigation', 'container' => false, 'menu_class' => 'sub-nav'
);
$subject = wp_nav_menu( $args );
$search = array('<ul', '</ul>', '<li', '</li>');
$replace = array('<dl', '</dl>', '<dd', '</dd>');
@bewho
bewho / cached_nav_menu.php
Created May 27, 2018 04:14 — forked from marcinzaremba/cached_nav_menu.php
Primitve cached version of wp_nav_menu
/**
* cached_nav_menu
*
* primitive cache of wp_nav_menu using
* WP Transient APIs
*
* @author Marcin Zaremba
* @param $args arguments passed originally to wp_nav_menu
*/
function cached_nav_menu($args) {
@bewho
bewho / remove_revslider_meta_generator.php
Created May 25, 2018 10:17 — forked from jimi008/remove_revslider_meta_generator.php
Remove woo framework, canvas theme & Revolution slider meta generator from site
<?php
function remove_revslider_meta_tag() {
return '';
}
add_filter( 'revslider_meta_generator', 'remove_revslider_meta_tag' );
?>
@bewho
bewho / sysctl.conf
Created March 17, 2018 08:58
自用优化的 sysctl.conf 配置 @2018.03.17
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
{"sig":"14d84fdbd7b480a147ea98011619171ada3cb6768c6c4ce83d025d3b9228bfc0a3b83e1640b75de288848de3037696e50f1377e3197d216418b88d20c7b4806f1","msghash":"68396b16b03ba84aac516a034c05088da90147704b14ba1f67b59068c47e3785"}
@bewho
bewho / sysctl.conf
Created February 28, 2018 12:31
内核优化
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
@bewho
bewho / php-fpm.conf
Created February 24, 2018 02:45 — forked from ivmm/php-fpm.conf
;;;;;;;;;;;;;;;;;;;;;
; FPM Configuration ;
;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;
; Global Options ;
;;;;;;;;;;;;;;;;;;
[global]
pid = run/php-fpm.pid
upstream redis {
server 127.0.0.1:6379;
keepalive 512;
}
server {
listen 80;
server_name www.mf8.biz mf8.biz;
access_log off;
index index.html index.htm index.php;
@bewho
bewho / custom.css
Created February 22, 2018 07:43
fade-in
@keyframes fade-in {
0% {opacity: 0;}/*初始状态 透明度为0*/
40% {opacity: 0;}/*过渡状态 透明度为0*/
100% {opacity: 1;}/*结束状态 透明度为1*/
}
@-webkit-keyframes fade-in {/*针对webkit内核*/
0% {opacity: 0;}
40% {opacity: 0;}
100% {opacity: 1;}
<?php
/**
* Implement the Custom Header feature.
*/
require get_parent_theme_file_path( '/inc/custom-header.php' );
/**
* Custom template tags for this theme.
*/