This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Fetch posts in chunks. | |
* | |
* This function fetches posts in chunks of a specified size, which can be useful for large datasets. | |
* | |
* @param string $post_type The type of post to fetch. Default is 'post'. | |
* @param int $posts_per_page The number of posts to fetch per page. Default is 100. | |
* @param array $custom_args Custom arguments to pass to WP_Query. Default is an empty array. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set from https://www.npmjs.com/package/@wordpress/scripts | |
// Add package.json with the @wordpress/scripts dependency. | |
// Add a root file called webpack.config.js | |
// Import the original config from the @wordpress/scripts package. | |
const defaultConfig = require( '@wordpress/scripts/config/webpack.config' ); | |
// Import the helper to find and generate the entry points in the src directory | |
const { getWebpackEntryPoints } = require( '@wordpress/scripts/utils/config' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get Post with Fields | |
* | |
* Returns a post with it's ACF fields | |
* attached to it | |
* | |
* @NOTE We don't use $post as a variable | |
* inside here so we don't mess with the | |
* WordPress global variable | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* SearchWP VERSION 3.x | |
* Tell SearchWP to index the Title from a Relationship ACF field. | |
*/ | |
function my_searchwp_read_next_field( $meta_value, $meta_key, $the_post ) { | |
$acf_field_name = 'read_next'; // The ACF Relationship field name. | |
// If we're not indexing the Read Next field, return the existing meta value. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AL : Alabama | |
AK : Alaska | |
AZ : Arizona | |
AR : Arkansas | |
CA : California | |
CO : Colorado | |
CT : Connecticut | |
DE : Delaware | |
DC : District of Columbia | |
FL : Florida |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: node:6.11.2 | |
pipelines: | |
custom: # Pipelines that are triggered manually | |
deployment-to-production-init: | |
- step: | |
caches: | |
- node | |
script: # Modify the commands below to build your repository. | |
- npm install -g gulp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Advanced Custom Fields: Nowhere location rules | |
Description: Adds a "Nowhere" location rule in ACF | |
*/ | |
add_filter('acf/location/rule_types', function($rules) { | |
$rules['Extra']['nowhere'] = 'Nowhere'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_head', function() { | |
?> | |
<script>(function($) { | |
$(document).on('facetwp-loaded', function() { | |
$('.facetwp-input-wrap').each(function() { | |
if ($(this).find('.facetwp-search-submit').length < 1) { | |
$(this).find('.facetwp-search').after('<button class="facetwp-search-submit" onclick="FWP.refresh()">Submit</button>'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Mixin rem-calc for converting px units into rem units | |
/// @example scss - Usage | |
/// .element { | |
/// font-size: rem-calc(20); | |
/// } | |
/// | |
/// @example css - CSS Output | |
/// .element { | |
/// font-size: 1.25rem; | |
/// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = array( | |
'post_type' => 'location', | |
'posts_per_page' => -1, | |
'order' => 'ASC', | |
'orderby' => 'title', | |
'facetwp' => true, | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'advertiser-level', |
NewerOlder