Skip to content

Instantly share code, notes, and snippets.

@newloong
newloong / gist:a195854deeca50831daa553c1347f477
Created April 3, 2019 07:54 — forked from alimd/gist:3865955
Create A Somple Product Catalog width Wordpress.

ali.md/pcwp

Step One: Create the custom post type

The following code goes into the functions.php file:

// Create A Somple Product Catalog width Wordpress. ali.md/pcwp
// Step One: Create the custom post type
@newloong
newloong / shadowsocks_ubuntu1604.org
Created March 16, 2019 00:13
Install Shadowsocks-libev + simple-obfs on Ubuntu 16.04

Install Shadowsocks-libev + simple-obfs on Ubuntu 16.04

Install shadowsocks-libev via Ubuntu PPA

sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:max-c-lv/shadowsocks-libev -y
sudo apt-get update
sudo apt install shadowsocks-libev
@newloong
newloong / Bootstrap4Nav-Sage9.md
Created February 13, 2019 13:53 — forked from smutek/Bootstrap4Nav-Sage9.md
Bootstrap 4 Walker for Sage 9

Credit

This is a frankensteind version of the current Soil nav walker, by the Roots team, and Michael Remoero's Sagextras walker. All credit goes to those good folks. :)

Use

  • Replace the contents of header.blade.php with the attached header.
  • Copy the walker.php file to the /app directory.
  • Add walker.php to the Sage required files array in resources/functions.php - eg. on a stock Sage install the entry would look like:
/**
/**
* jQuery iLightBox - Revolutionary Lightbox Plugin
* http://www.ilightbox.net/
*
* @version: 2.2.3 - June 03, 2017
*
* @author: Hemn Chawroka
* http://www.iprodev.com/
*
*/
@newloong
newloong / aggregate_files.php
Created December 19, 2018 02:50 — forked from steveclason/aggregate_files.php
Override Header Layout in Avada Child Theme
<?php
/* Override (modify) the Avada header layouts in a child theme by establishing a local version. */
/* Avada has 6 header layouts selectable via Avada > Theme Options > Header > Header Content. These map to files at
"/wp-content/themes/Avada/templates". You can use your browser's devtools to look in the header for something like
'<div class="fusion-header-v1 ... ">' which will help identify what's being used, if you don't already know.
*/
// Copy this block from "/wp-content/themes/Avada/templates/header.php". If you are not using header_1 then copy the appropriate block.
if ( ! function_exists( 'avada_header_1' ) ) {
@newloong
newloong / backup.sh
Created December 13, 2018 10:12 — forked from MrTrustor/backup.sh
Simple backup with Duplicity and AWS Glacier
#!/bin/bash
# Copyright 2017 Théo Chamley
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
# to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or
@newloong
newloong / gist:ca3c996b027cc196da7e4f75aff6456c
Created December 6, 2018 04:08 — forked from adamrosloniec/gist:a3995cc3aec2537d7ee4
wordpress acf bootstrap carousel - simple example
// bootstrap carousel build with wordpress acf - simple method
// with add class 'active' to first div - MUST BE!
// also you must add css:
// .item {display:none;}
// .item.active {display:block;}
// first method
<ul id="carousel" class="slider carousel" data-ride="carousel" data-interval="<?php if ( get_field('slider__speed','option') ) { the_field('slider__speed','option'); } else { echo '4000'; } ?>"><!-- add sub_field to change slide time --!>
<?php if ( have_rows('slider__item','option') ) : ?> <!-- take slides from Options Page > slider__item -->
#!/bin/bash
# assign env var, if set
HB="${HOMEBREW_PREFIX:=/usr/local}"
find -L "${HB}/opt" -name 'INSTALL_RECEIPT.json' -maxdepth 2 -print > /tmp/homebrew-installed.txt
printf '' > /tmp/homebrew-installed-w-options.txt
NAME=''
@newloong
newloong / submenu-descrption.php
Created August 14, 2018 07:25 — forked from atsea/submenu-descrption.php
WordPress: add description to submenu
<?php
/**
* start_lvl and end_lvl
* How can I add parent menu description to my Wordpress menu?
* http://stackoverflow.com/questions/29251897/how-can-i-add-parent-menu-description-to-my-wordpress-menu
*
* start_el
* * How to add menu descriptions to wordpress theme
* http://www.wpbeginner.com/wp-themes/how-to-add-menu-descriptions-in-your-wordpress-themes/
*/
@newloong
newloong / .htaccess
Created July 19, 2018 03:35 — forked from cfxd/.htaccess
Deploy WordPress (Bedrock) with Capistrano to a Shared Host (Bluehost). See http://cfxdesign.com/deploy-wordpress-with-capistrano-on-bluehost/
RewriteEngine on
#change dev.example.com to your domain name
RewriteCond %{HTTP_HOST} ^(www.)?dev.example.com$
RewriteCond %{REQUEST_URI} !^/current/web/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /current/web/$1
#change dev.example.com to your domain name
RewriteCond %{HTTP_HOST} ^(www.)?dev.example.com$
RewriteRule ^(/)?$ current/web/index.php [L]