Type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
| <?php | |
| /* | |
| Plugin Name: WP_Rewrite endpoints demo | |
| Description: A plugin giving example usage of the WP_Rewrite endpoint API | |
| Plugin URI: http://make.wordpress.org/plugins/2012/06/07/rewrite-endpoints-api/ | |
| Author: Jon Cave | |
| Author URI: http://joncave.co.uk/ | |
| */ | |
| function makeplugins_endpoints_add_endpoint() { |
| <?php | |
| // This is the cleaner code per request of a thread in the LinkedIn group "WordPress" | |
| // ... | |
| // register and enqueue loadCSS | |
| function load_scripts_and_styles() { | |
| // register loadCSS | |
| wp_register_script( 'load-css-async', get_stylesheet_directory_uri() . '/path/to/js/loadCSS.js', array(), '', false ); |
| <?php | |
| // SHOW YOAST PRIMARY CATEGORY, OR FIRST CATEGORY | |
| $category = get_the_category(); | |
| $useCatLink = true; | |
| // If post has a category assigned. | |
| if ($category){ | |
| $category_display = ''; | |
| $category_link = ''; | |
| if ( class_exists('WPSEO_Primary_Term') ) |
| <?php | |
| /* | |
| Creates and end-point that get Yoast SEO meta tags... | |
| */ | |
| add_action('rest_api_init', 'add_yoast_data'); | |
| function add_yoast_data() | |
| { | |
| // Add your post types here... | |
| register_rest_field(array( |
| # robots.txt for wordpress | |
| # based on https://gist.github.com/chuckreynolds/135728 | |
| User-agent: * | |
| Disallow: /wp-admin/ | |
| Disallow: /cgi-bin/ | |
| Disallow: /trackback/ | |
| Disallow: /comment-page-* | |
| Disallow: /?s=* |
| import { withRouter } from 'next/router'; | |
| import Link from 'next/link'; | |
| import React, { Children } from 'react'; | |
| const ActiveLink = ({ router, children, ...props }) => { | |
| const child = Children.only(children); | |
| let className = child.props.className || ''; | |
| if (router.pathname === props.href && props.activeClassName) { | |
| className = `${className} ${props.activeClassName}`.trim(); |
| const range = (start, end, step = 1) => { | |
| const forLoop = fn => { | |
| for (let x = start; x <= end; x += step) fn(x) | |
| } | |
| const between = (v, start, end) => v >= start && v <= end | |
| const hasValue = v => between(v, start, end) || between(v, end, start) | |
| const iterate = function* (mapFn) { | |
| for (let x = start; x <= end; x += step) yield mapFn ? mapFn(x) : x |
| THE RAVEN. | |
| Once upon a midnight dreary, while I pondered, weak and weary, | |
| Over many a quaint and curious volume of forgotten lore, | |
| While I nodded, nearly napping, suddenly there came a tapping, | |
| As of some one gently rapping, rapping at my chamber door. | |
| "'T is some visiter," I muttered, "tapping at my chamber door-- | |
| Only this, and nothing more." |
Type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
export CACHE_CLEAR_USERNAME=[user]
export CACHE_CLEAR_PASSWORD=[pass]
export ZIM_DEBUG=development
Username/Password used for CACHE_CLEAR can be found here. This allows for cache resets anytime you append the resetCache=true query param.