If you're looking for the helper functions, see https://github.com/mrwweb/acf-helper-functions/. Now a full-blown repo! Feel free to contribute.
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 | |
// Resuable instance of WP_Query with preset $args | |
class Extended_WP_Query extends WP_Query { | |
function __construct( $args = array() ) { | |
$args = wp_parse_args( $args, array( | |
// some $args go here for reuse | |
) ); | |
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
/* this is the "root" in "root em." */ | |
html { | |
font-size: 62.5%; /* Now 10px = 1rem! */ | |
} | |
body { | |
font-size: 16px; /* px fallback */ | |
font-size: 1.6rem; /* default font-size for document */ | |
line-height: 1.5; /* a nice line-height */ | |
} |
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
// Hide Yoast SEO by Default | |
function hide_yoast( $hidden ) { | |
$hidden[] = 'wpseo_meta'; | |
return $hidden; | |
} | |
add_filter( 'default_hidden_meta_boxes', 'hide_yoast' ); |
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 | |
/** | |
* Make a list of links to WordPress posts | |
* | |
* Works great with the Relationship field from Advanced Custom Fields | |
* | |
* @param array $posts array of post objects or post_ids | |
* @param string $sep separater | |
* @param string $before output before the list | |
* @param string $after output after the list |
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_image_size( 'wcp-front-feature', 440, 300, true ); | |
add_theme_support( 'featured-content', array( | |
'featured_content_filter' => 'wcp_featured_posts', | |
'max_posts' => 2, | |
) ); | |
function wcp_get_featured_posts() { |
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
function flexslider_hg_admin_icon() | |
{ | |
echo ' | |
<style> | |
/* | |
Selectors: | |
1. Admin Menu | |
2. "Site Content" Dashboard Widget (Post Types only) | |
*/ | |
#adminmenu #menu-posts-slides div.wp-menu-image:before, |
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
<a href="http://google.com" title="Google">Google</a> |
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 | |
/** | |
* Example filter to add text style to TinyMCE filter with Mark's "MRW TinyMCE Mods" plugin | |
* | |
* Adds a "Text Styles" submenu to the "Formats" dropdown | |
* | |
* This would go in a functions.php file or mu-plugin so you don't have to modify the original plugin. | |
* | |
* $styles array Contains arrays of style_format arguments to define styles. | |
* Note: Should be an "array of arrays" |
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
/* ID Link Mimetypes for Common Filetypes */ | |
a[href$=".doc"]::after { | |
content: " [DOC]"; | |
} | |
a[href$=".docx"]::after { | |
content: " [DOCX]"; | |
} | |
a[href$=".rtf"]::after { | |
content: " [RTF]"; |
OlderNewer