This file contains hidden or 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 | |
//Change error message of AJAX submitted form. | |
add_filter( 'caldera_forms_render_notices', function( $notices ){ | |
//Will NOT be set (during AJAX return) if there is no error | |
if( isset( $notices[ 'error' ], $notices[ 'error' ][ 'note' ] ) ){ | |
$notices[ 'error' ][ 'note' ] = 'Form could not be submitted, please correct erorrs or give us a call.'; | |
} | |
return $notices; | |
}); |
This file contains hidden or 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 | |
function prefix_get_first_attachment( $post ) { | |
$attachment = get_children( | |
array( | |
'post_parent' => $post->ID, | |
'post_type' => 'attachment', | |
'post_mime_type' => 'image', | |
'order' => 'DESC', | |
'numberposts' => 1, | |
) |
This file contains hidden or 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 | |
function prefix_remove_first_image( $content ) { | |
if ( !is_page() && !is_feed() && !is_home() ){ | |
$content = preg_replace( "/<img[^>]+\>/i", "", $content, 1 ); | |
} | |
return $content; | |
} | |
add_filter( 'the_content', 'prefix_remove_first_image' ); |
This file contains hidden or 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 | |
/** | |
* Using wp_dropdown_categories with the post type filter applied. | |
* | |
* @link https://joshuadnelson.com/category-taxonomy-dropdown-filtered-by-post-type/ | |
*/ | |
// Taxonomy dropdown arguments | |
$args = array( | |
'taxonomy' => 'department', |
This file contains hidden or 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 | |
wp_nav_menu( array( | |
'menu' => 'Menu Name', | |
'sub_menu' => true, | |
'direct_parent' => true | |
) ); |
This file contains hidden or 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 | |
/** | |
* Template Loader | |
* | |
* This file is read by WordPress to generate the plugin information in the plugin | |
* admin area. This file also includes all of the dependencies used by the plugin, | |
* registers the activation and deactivation functions, and defines a function | |
* that starts the plugin. | |
* | |
* @link https://github.com/misfist/template-loader |
This file contains hidden or 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 | |
function prefix_remove_jetpack_styles() { | |
wp_deregister_style( 'jetpack-carousel' ); // Carousel | |
wp_deregister_style( 'the-neverending-homepage' ); // Infinite Scroll | |
wp_deregister_style( 'post-by-email' ); // Post by Email | |
wp_deregister_style( 'publicize' ); // Publicize | |
wp_deregister_style( 'sharedaddy' ); // Sharedaddy | |
wp_deregister_style( 'sharing' ); // Sharedaddy Sharing | |
wp_deregister_style( 'stats_reports_css' ); // Stats | |
wp_deregister_style( 'jetpack-widgets' ); // Widgets |
This file contains hidden or 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
# Ignore everything # | |
** | |
!wp-content/ | |
wp-content/** | |
!wp-content/themes/ | |
!wp-content/plugins/ | |
wp-content/themes/** | |
wp-content/plugins/** | |
# Add two rules for each Theme or Plugin you want to include: |
This file contains hidden or 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 | |
/** | |
* Plugin Name: Shortcake UI Pullquote Demo | |
* Plugin URI: | |
* Description: Try Shortcake with pull-quite shortcode | |
* Version: 1.0.0 | |
* Author: Mte90 | |
* License: GPL2 | |
*/ |
This file contains hidden or 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
# ----------------------------------------------------------------- | |
# .gitignore for WordPress @salcode | |
# ver 20150227 | |
# | |
# From the root of your project run | |
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore | |
# to download this file | |
# | |
# By default all files are ignored. You'll need to whitelist | |
# any mu-plugins, plugins, or themes you want to include in the repo. |
NewerOlder