Skip to content

Instantly share code, notes, and snippets.

View chaselivingston's full-sized avatar

Chase Livingston chaselivingston

View GitHub Profile
function jetpackme_filter_exclude_category( $filters ) {
$filters[] = array( 'not' => array(
'terms' => array( 'category.slug' =>
array( 'donotshow', 'events' )
)
) );
return $filters;
}
add_filter(
Requested URL: https://public-api.wordpress.com/rest/v1/sites/ocadernodereceitas.com.br
Response Code: 200
Response:
{
"ID": 113937576,
"name": "O Caderno de Receitas",
"description": "Comida de m\u00e3e colocada \u00e0 prova, palpites e uma pitada de nostalgia. Por Mariana Weber",
"URL": "http:\/\/ocadernodereceitas.com.br",
"jetpack": true,
"subscribers_count": 0,
if ( !empty( $_SERVER['HTTP_INCAP_CLIENT_IP'] ) ) {
$forwarded_ips = explode( ',', $_SERVER['HTTP_INCAP_CLIENT_IP'] );
$_SERVER['REMOTE_ADDR'] = $forwarded_ips[0];
unset( $forwarded_ips );
}
if ( !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
$forwarded_ips = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] );
$_SERVER['REMOTE_ADDR'] = $forwarded_ips[0];
unset( $forwarded_ips );
}
add_filter( 'jetpack_sharing_pinterest_widget_type', 'bk_jetpack_pinterest_widget' );
function bk_jetpack_pinterest_widget( $widget ){
return 'buttonBookmark';
}
function cl_tweak_carousel() {
global $post;
if ( $post->ID == 23) {
return true;
}
}
add_filter( 'jp_carousel_maybe_disable', 'cl_tweak_carousel');
if ( ! isset( $content_width ) ) {
$content_width = 730;
}
function jetpackme_exclude_related_post( $exclude_post_ids, $post_id ) {
// $post_id is the post we are currently getting related posts for
$exclude_post_ids[] = 871;
return $exclude_post_ids;
}
add_filter( 'jetpack_relatedposts_filter_exclude_post_ids', 'jetpackme_exclude_related_post', 20, 2 );
## EXPIRES CACHING ##
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"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
add_filter( 'pre_option_job_manager_alerts_page_id', 'wpml_pre_option_job_manager_alerts_page_id' );
function wpml_pre_option_job_manager_alerts_page_id( $id ) {
return icl_object_id( $id, 'post', true );
}