Skip to content

Instantly share code, notes, and snippets.

View mikeyarce's full-sized avatar

Mikey Arce mikeyarce

View GitHub Profile
@mikeyarce
mikeyarce / disable-is-on-page.php
Last active August 29, 2015 14:14
Disable Infinite Scroll on a page
function tweakjp_custom_is_support() {
$supported = current_theme_supports( 'infinite-scroll' ) && ( is_home() || is_archive() ) && ( !is_page( 'woocommerce' ) );
return $supported;
}
add_filter( 'infinite_scroll_archive_supported', 'tweakjp_custom_is_support' );
@mikeyarce
mikeyarce / disable-full-size-carousel.css
Last active August 29, 2015 14:15
Disable "View Full Size" in Carousel
@mikeyarce
mikeyarce / disable-auto-fill-contact-form.php
Last active August 29, 2015 14:15
Disable auto-fill for contact form (3.2+)
add_filter( 'jetpack_auto_fill_logged_in_user', '__return_true' );
@mikeyarce
mikeyarce / disable-comments-carousel.php
Last active August 29, 2015 14:15
Disable Comments in Carousel
@mikeyarce
mikeyarce / custom-post-type-with-publicize.php
Last active August 29, 2015 14:15
Register Custom Post Type
function codex_custom_init() {
$args = array(
'public' => true,
'label' => 'Books',
'supports' => array (
'title',
'editor',
'excerpt',
'publicize',
'thumbnail',
# Shows little symbol '±' if you're currently at a git repo and '○' all other times
function prompt_char {
git branch >/dev/null 2>/dev/null && echo '±' && return
echo ''
}
PROMPT='
%{$fg[blue]%}%n%{$reset_color%} on %{$fg[yellow]%}%m%{$reset_color%} in %{$fg[green]%}%~%b%{$reset_color%} $(git_time_since_commit)$(check_git_prompt_info)
${vcs_info_msg_0_}$(prompt_char) '
// First, make sure Jetpack doesn't concatenate all its CSS
add_filter( 'jetpack_implode_frontend_css', '__return_false' );
// Then, remove each CSS file, one at a time
function jeherve_remove_all_jp_css() {
wp_deregister_style( 'AtD_style' ); // After the Deadline
wp_deregister_style( 'jetpack_likes' ); // Likes
wp_deregister_style( 'jetpack_related-posts' ); //Related Posts
wp_deregister_style( 'jetpack-carousel' ); // Carousel
wp_deregister_style( 'grunion.css' ); // Grunion contact form
@mikeyarce
mikeyarce / custom-success-msg-cf-jetpack.php
Last active August 29, 2015 14:17
Custom Contact Form Success Message - Jetpack
function ma_change_grunion_success_message( $msg ) {
global $contact_form_message;
return '<h3>' . 'My custom success message' . '</h3>' . wp_kses($contact_form_message, array('br' => array(), 'blockquote' => array()));;
}
add_filter( 'grunion_contact_form_success_message', 'ma_change_grunion_success_message' );
@mikeyarce
mikeyarce / deactivate-protect.php
Created March 30, 2015 18:47
Disable Protect
function jetpackme_force_deactivate_protect() {
if ( class_exists( 'Jetpack' ) ) {
Jetpack::deactivate_module( 'protect' );
}
}
add_action( 'init', 'jetpackme_force_deactivate_protect' );
@mikeyarce
mikeyarce / hook-sidebar-1.php
Created April 8, 2015 16:54
add content to top of sidebar in Jetpack mobile theme
function jetpackme_is_mobile() {
// Are Jetpack Mobile functions available?
if ( ! function_exists( 'jetpack_is_mobile' ) )
return false;
// Is Mobile theme showing?
if ( isset( $_COOKIE['akm_mobile'] ) && $_COOKIE['akm_mobile'] == 'false' )
return false;