Modifying Swift Focus, a Genesis child theme, allows you to tailor your site to better fit your needs. Here’s how you can use the available filter and action to make customizations, and some recommendations for further modifications.
1. Available Filters
Swift Focus provides a filter to customize the HTML for social sharing links:
- swift_theme_social_share: This filter allows you to modify the full HTML for the social sharing links in the theme.
Example Usage
To customize the HTML for social sharing links, you can use the swift_theme_social_share
filter in your theme’s functions.php
file or a custom plugin. Here’s an example of how you might use this filter:
add_filter('swift_theme_social_share', 'custom_social_share_html');
function custom_social_share_html($html) {
// Custom HTML for social sharing links
$custom_html = '
<div class="social-share">
<a href="https://twitter.com/share?url=' . get_permalink() . '&text=' . get_the_title() . '" target="_blank">Share on Twitter</a>
<a href="https://www.facebook.com/sharer/sharer.php?u=' . get_permalink() . '" target="_blank">Share on Facebook</a>
<a href="https://www.linkedin.com/shareArticle?mini=true&url=' . get_permalink() . '&title=' . get_the_title() . '" target="_blank">Share on LinkedIn</a>
</div>';
return $custom_html;
}
2. Available Actions
Swift Focus also provides an action to add content to the theme’s banner:
- swift_theme_banner_content: Use this action to modify the content displayed in the banner area of the theme.
Example Usage
To add or change content in the theme’s banner, you can use the swift_theme_banner_content
action:
add_action('swift_theme_banner_content', 'custom_banner_content');
function custom_banner_content() {
echo '<div class="custom-banner-content">Welcome to our site! Enjoy our special offers.</div>';
}
3. Genesis Hooks
Since Swift Focus is a Genesis child theme, you can also use Genesis hooks for further customization. Here are some commonly used Genesis hooks:
- genesis_before_header
- genesis_after_header
- genesis_before_footer
- genesis_after_footer
Example Usage
To add content after the header using a Genesis hook:
add_action('genesis_after_header', 'custom_after_header_content');
function custom_after_header_content() {
echo '<div class="custom-content">This is custom content after the header.</div>';
}
4. Customizer Plugin
For more extensive customizations without worrying about updates overwriting your changes, we recommend downloading the customizer plugin from the theme’s help section. This plugin allows you to make and manage your customizations easily and safely.
Need More Help?
If you have any questions or need further assistance with modifying Swift Focus, feel free to reach out to our support team through our Contact Page. We’re here to help you make the most of your Swift Focus theme!