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 | |
/* @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' ) ) { |
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 | |
/* @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' ) ) { |
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 | |
/* @link https://anythinggraphic.net/yoast-seo-add-custom-social-share-images-for-archive-category-pages-in-wordpress | |
/* Add custom Twitter Social Share images for Yoast SEO for Archive pages | |
----------------------------------------------------------------------------------------*/ | |
add_filter( 'wpseo_twitter_image', 'ag_yoast_seo_tw_share_images', 10, 1 ); | |
function ag_yoast_seo_tw_share_images( $img ) { | |
if( is_post_type_archive( 'archivename') ) { | |
$img = get_stylesheet_directory_uri().'/images/your-image-file.jpg'; | |
} | |
if( is_category( 'categoryname') ) {{ |
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 | |
/* @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') ) { |
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
# https://anythinggraphic.net/disable-emojis-in-wordpress-without-a-plugin | |
# BEGIN DISABLE ETAG HEADER | |
FileETag None | |
# END DISABLE ETAG HEADER |
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
# 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" |
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
# 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 |
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 | |
/* @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; | |
} |
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 | |
/* Put a unique ID on Gravity Form (single form ID) entries. | |
----------------------------------------------------------------------------------------*/ | |
add_filter("gform_field_value_uuid", "get_unique"); | |
function get_unique(){ | |
$prefix = "SLP2017-"; // update the prefix here | |
do { |
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 | |
/* @link https://anythinggraphic.net/change-entry-title-post-links-archives-genesis/ | |
/* Change the link on the entry-title for each post to a custom one on Archives page | |
----------------------------------------------------------------------------------------*/ | |
add_filter( 'genesis_post_title_output', 'ag_custom_post_title_link' ); | |
function ag_custom_post_title_link( $title ) { | |
if( is_archive() ) { | |
$post_title = get_the_title( get_the_ID() ); | |
$title = '<h2 class="entry-title" itemprop="headline"><a href="' . get_field('link') . '" target="new">' . $post_title . '</a></h2>'; |