Skip to content

Instantly share code, notes, and snippets.

View mattisbusycom's full-sized avatar

Matthew M Kaufman mattisbusycom

View GitHub Profile
# First, create the synonyms file /opt/elasticsearch/name_synonyms.txt
# with the contents:
#
# rob,bob => robert
#
## CREATE THE INDEX WITH ANALYZERS AND MAPPINGS
curl -XPUT 'http://127.0.0.1:9200/test/?pretty=1' -d '
{

Integrating WP API into Core

Plan for integrating WP API into core

This document describes the process of integrating the WordPress JSON REST API ("API project") into the WordPress core codebase ("core").

Motivation

Accessing data remotely is a common goal for many WordPress users and developers. The ability to access and update data remotely is used by desktop publishing software, mobile applications, and in-browser applications. These

<header class="clearfix">
<div class="container">
<div class="header-left">
<h1>Your company</h1>
</div>
<div class="header-right">
<label for="open">
<span class="hidden-desktop"></span>
</label>
<input type="checkbox" name="" id="open">

Multi-Toggle Navigation

The multi-toggle is basically just nested accordions. The user taps on the parent category to reveal children categories underneath. Once enough screen real estate becomes available, they convert to the usual multi-level dropdown we’re used to seeing.

A Pen by Brad Frost on CodePen.

License.

<?php
/** @var $collection Mage_Catalog_Model_Resource_Category_Collection */
$collection = Mage::getModel('catalog/category', array('disable_flat' => true))->getCollection();
// ... custom stuff
<block type="cms/block" name="block_name">
<action method="setBlockId"><id>block_code</id></action>
</block>
{{block type="cms/block" block_id="block_code"}}
{{block type="catalog/product_list" category_id="79" template="catalog/product/list_random.phtml"}}
SET SQL_MODE = '';
SET @rownum=0;
UPDATE eav_attribute_option
LEFT JOIN (
SELECT tmp.*, @rownum:=@rownum+1 AS rank FROM (
SELECT eao.*, eaov.`value`
FROM eav_attribute_option eao
LEFT JOIN `eav_attribute_option_value` eaov ON eao.option_id=eaov.option_id AND eaov.store_id=0
WHERE attribute_id = 292
ORDER BY CAST(CAST(eaov.value AS DECIMAL(3,0)) as UNSIGNED INTEGER), eaov.value