Skip to content

Instantly share code, notes, and snippets.

View anythinggraphic's full-sized avatar
☺️
Be the reason someone smiles today.

Kevin Donnigan anythinggraphic

☺️
Be the reason someone smiles today.
View GitHub Profile
/*
Original link http://www.templatemonster.com/blog/style-checkboxes-radio-buttons-css adapted to Gravity Forms.
Uses Font Awesome. Make sure to wrap labels in <span> like so:
<script type="text/javascript">
jQuery(function($) {
$(".gfield_checkbox label, .gfield_radio label").wrapInner("<span></span>")
});
</script>
*/
@anythinggraphic
anythinggraphic / functions.php
Last active August 31, 2017 22:05
Add custom Facebook Social Share descriptions for Yoast SEO for Archive pages
<?php
/* @link https://anythinggraphic.net/yoast-seo-add-custom-social-share-images-for-archive-category-pages-in-wordpress
/* Add custom Facebook Social Share descriptions for Yoast SEO for Archive pages
----------------------------------------------------------------------------------------*/
add_filter( 'wpseo_opengraph_desc', 'ag_yoast_seo_fb_share_descriptions' );
function ag_yoast_seo_fb_share_descriptions( $desc ) {
if( is_post_type_archive( 'posttypename' ) ) {
$desc = 'Design and development projects by Anything Graphic.';
}
if( is_category( 'categoryname' ) ) {
@anythinggraphic
anythinggraphic / functions.php
Last active August 31, 2017 22:05
Add custom Twitter Social Share descriptions for Yoast SEO for Archive pages
<?php
/* @link https://anythinggraphic.net/yoast-seo-add-custom-social-share-images-for-archive-category-pages-in-wordpress
/* Add custom Twitter Social Share descriptions for Yoast SEO for Archive pages
----------------------------------------------------------------------------------------*/
add_filter( 'wpseo_metadesc', 'ag_yoast_seo_tw_share_descriptions', 10, 1 );
function ag_yoast_seo_tw_share_descriptions( $desc ) {
if( is_post_type_archive( 'portfolio' ) ) {
$desc = 'Design and development projects by Anything Graphic.';
}
if( is_category( 'categoryname' ) ) {
@anythinggraphic
anythinggraphic / functions.php
Last active August 31, 2017 21:34
Add custom Facebook Social Share images for Yoast SEO for Archive pages
<?php
/* @link https://anythinggraphic.net/yoast-seo-add-custom-social-share-images-for-archive-category-pages-in-wordpress
/* Add custom Facebook Social Share images for Yoast SEO for Archive pages
----------------------------------------------------------------------------------------*/
add_filter( 'wpseo_opengraph_image', 'ag_yoast_seo_fb_share_images', 10, 1 );
function ag_yoast_seo_fb_share_images( $img ) {
if( is_post_type_archive( 'archivename') ) {
$img = get_stylesheet_directory_uri().'/images/your-image-file.jpg';
}
if( is_category( 'categoryname') ) {
@anythinggraphic
anythinggraphic / .htaccess
Last active May 10, 2017 23:24
Remove ETag header. Use in conjunction with Cache-Control and Expires header.
# https://anythinggraphic.net/disable-emojis-in-wordpress-without-a-plugin
# BEGIN DISABLE ETAG HEADER
FileETag None
# END DISABLE ETAG HEADER
@anythinggraphic
anythinggraphic / .htaccess
Last active May 10, 2017 23:23
Enable browser caching with .htaccess.
# https://anythinggraphic.net/disable-emojis-in-wordpress-without-a-plugin
## BEGIN BROWSER CACHING (EXPIRES CACHING)
## EXPIRES HEADER CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
@anythinggraphic
anythinggraphic / .htaccess
Last active May 10, 2017 23:23
GZip compression in .htaccess file.
# https://anythinggraphic.net/disable-emojis-in-wordpress-without-a-plugin
# BEGIN GZIP COMPRESSION
<IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
@anythinggraphic
anythinggraphic / functions.php
Created April 15, 2017 22:00
Paste As Text by default in the WordPress editor.
<?php
/* @link https://anythinggraphic.net/paste-as-text-by-default-in-wordpress
/* Use Paste As Text by default in the editor
----------------------------------------------------------------------------------------*/
add_filter('tiny_mce_before_init', 'ag_tinymce_paste_as_text');
function ag_tinymce_paste_as_text( $init ) {
$init['paste_as_text'] = true;
return $init;
}
@anythinggraphic
anythinggraphic / genesis-conditional-layout.php
Last active January 29, 2017 03:53
Conditionally force full-width layout
<?php
/* Force full width conditionally
----------------------------------------------------------------------------------------*/
add_action( 'genesis_meta', 'bw_force_layout' );
function bw_force_layout() {
if ( is_front_page() ) {
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
}
}
@anythinggraphic
anythinggraphic / functions.php
Last active January 29, 2017 03:45
Allow shortcodes in the Genesis Author Box for Users > Profile.
<?php
/* @link https://anythinggraphic.net/allow-shortcodes-in-author-box-for-genesis/
/* Allow shortcodes in the Author Box for users
----------------------------------------------------------------------------------------*/
add_filter( 'genesis_author_box', 'do_shortcode', 20 );