Post
- post_type
- post_template
- post_status
- post_format
- post_category
- post_taxonomy
- post
<?php | |
/** | |
* Disable Yoast SEO's darn admin bar icon | |
*/ | |
function yoast_hide_admin_bar() { | |
global $wp_admin_bar; | |
$wp_admin_bar->remove_menu('wpseo-menu'); | |
} |
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
*/ | |
$args = array( |
<?php | |
/** | |
* Generate JSON sitemap for use with UnCSS | |
*/ | |
function show_sitemap() { | |
if (WP_ENV === 'development' && isset($_GET['show_sitemap'])) { | |
global: | |
sql_adapter: "default" | |
local: | |
vhost: "http://PROJECT.dev" | |
wordpress_path: "/srv/www/PROJECT/htdocs" # use an absolute path here | |
database: | |
name: "PROJECT_DB_NAME" | |
user: "external" |
function add_theme_features() { | |
// Add Image Sizes | |
$containerLG = 1170; // Change this if you have updated the largest bootstrap container width. | |
for ($i=1; $i <= 12; $i++) { | |
add_image_size( | |
'col-lg-'.$i, | |
ceil($containerLG / 12 * $i), | |
ceil($containerLG / 12 * $i) * 10, | |
false | |
); |
Post
# group_vars/{staging & production}/wordpress_sites.yml | |
[...] | |
wordpress_sites: | |
example.com: | |
site_hosts: [...] | |
[...] | |
matomo: | |
db: | |
user: matomo | |
host: localhost |
<?php | |
/** | |
* BASIC -- Header image | |
*/ | |
$basic_page_header = new FieldsBuilder('basic_page_header'); | |
$basic_page_header | |
->addImage('page_header_background_image') | |
->addText('page_header_title', [ | |
'instructions' => 'Leave empty to use the site title / name', |
playing around with animeJS.
A Pen by Henning Orth on CodePen.
<?php | |
// Adds a custom rule type. | |
add_filter( 'acf/location/rule_types', function( $choices ){ | |
$choices[ __('Other','acf') ]['wc_prod_attr'] = 'WC Product Attribute'; | |
return $choices; | |
} ); | |
// Adds custom rule values. | |
add_filter( 'acf/location/rule_values/wc_prod_attr', function( $choices ){ |