Filters
WordPress allows theme developers to make their themes customizable through advanced PHP solution called hooks
. There are 2 types of hooks: actions
and filters
. Chipmunk uses filter functionality to allow advanced users to modify some parts of the theme.
To be able to use them, you’ll need to create a child theme or use our example child theme available to download here.
chipmunk_google_fonts
// Add custom Google Fonts
function chipmunk_custom_google_fonts( $fonts ) {
$custom_fonts = array(
'Open Sans Condensed' => 'Open Sans Condensed',
'Merriweather' => 'Merriweather',
);
return array_merge( $fonts, $custom_fonts );
}
add_filter( 'chipmunk_google_fonts', 'chipmunk_custom_google_fonts' );
chipmunk_socials
// Add custom social profiles
function chipmunk_custom_socials( $socials ) {
$custom_socials = array( 'Digg' );
return array_merge( $socials, $custom_socials );
}
add_filter( 'chipmunk_socials', 'chipmunk_custom_socials' );
chipmunk_{type}_excerpt_length
// Change tile excerpt length for posts, resources and collections
function chipmunk_excerpt_length() {
return 20;
}
add_filter( 'chipmunk_post_excerpt_length', 'chipmunk_excerpt_length' );
add_filter( 'chipmunk_resource_excerpt_length', 'chipmunk_excerpt_length' );
add_filter( 'chipmunk_collection_excerpt_length', 'chipmunk_excerpt_length' );
chipmunk_resource_tabs
// Change resource tabs order
function chipmunk_reorder_resource_tabs() {
return array( 'popular', 'latest', 'featured' );
}
add_filter( 'chipmunk_resource_tabs', 'chipmunk_reorder_resource_tabs' );
// Remove the resource tabs completely
function chipmunk_remove_resource_tabs() {
return array();
}
add_filter( 'chipmunk_resource_tabs', 'chipmunk_remove_resource_tabs' );
chipmunk_submission_required_fields
// Change default required submission fields
function chipmunk_submission_required_fields() {
return array( 'name', 'collection' );
}
add_filter( 'chipmunk_submission_required_fields', 'chipmunk_submission_required_fields' );
chipmunk_submission_post_status
// Automatically publish resource submissions
function chipmunk_submission_post_status() {
return 'publish';
}
add_filter( 'chipmunk_submission_post_status', 'chipmunk_submission_post_status' );
chipmunk_term_max_length
// Change default maximum length of collection/category names in meta tags
function chipmunk_change_term_max_length() {
return 50; // Use 0 to display full term name
}
add_filter( 'chipmunk_term_max_length', 'chipmunk_change_term_max_length' );
chipmunk_shuffle_terms
// Enable shuffling term names in meta bar
function chipmunk_enable_shuffle_terms() {
return true;
}
add_filter( 'chipmunk_shuffle_terms', 'chipmunk_enable_shuffle_terms' );
chipmunk_newsletter_email_field
// Change the email field name to match your provider's setting
function chipmunk_change_newsletter_email_field() {
return 'email';
}
add_filter( 'chipmunk_newsletter_email_field', 'chipmunk_change_newsletter_email_field' );
chipmunk_newsletter_args
// Add extra hidden input fields
function chipmunk_change_newsletter_args() {
return array(
'meta_required' => 'email',
'redirect' => 'https://example.com',
);
}
add_filter( 'chipmunk_newsletter_args', 'chipmunk_change_newsletter_args' );
The Perfect Solution For All Curated Content
Start sharing the best hand-curated content to your audience now! No coding skills required!
Product
Get Help
Resources
The Family
© 2023 – Chipmunk
You have successfully joined our subscriber list. Please confirm your email.
We had trouble signing you up. Please try again.