Dante - Developers Documentation

Designed & Developed by Swift Ideas © 2013

Introduction

This documentation reference is provided for developers who wish to extend or modify Dante, preferably through the provided Child theme (to keep your changes when the main theme is updated).

How to use this documentation

This documentation is meant to be a reference for customers who wish to extend and/or modify Dante, beyond it's standard functionality. We have structured it in a way that sections the specific areas of the theme, and then references the files where you can find the specific functions. Below is an example for a file reference:

@filename: example.php
@location: /directory or root

Then this is a function reference:

sf_function()
This area is used to explain the function.

Child Theme

If you are thinking about modifying/extending the core functionality of Dante, then we thoroughly recommend that you use the provided child theme. This will allow you to override the functions you can find detailed in this documentation, and add files that you have modified to reference. This way when the main theme is updated, your changes will not be lost.

Documentation Improvements

If you have any recommendations or requests for improving this documentation, then please let us know. We are always looking for ways to make it easier for our users, and we'll be happy to hear from you. Please contact us via the form on our ThemeForest profile.

Comments

The comments functions configure the output code for each comment that is displayed within the theme.

@filename: sf-comments.php
@location: /includes
sf_custom_comments()
This function outputs code for each comment that is displayed.
custom_pings()
This function outputs code for each ping that is displayed.

Blog

Dante has various blog options that allow you to configure the display for the blog page builder asset, archive, category, and search results pages.

@filename: sf-blog.php
@location: /includes
sf_blog_items()
This function outputs blog items, based on a number of parameters such as blog type, category, and other options.
sf_blog_aux()
This function outputs the blog aux area above the blog items in the blog page builder asset.

Post Formats

Dante supports 10 post formats; Standard, Audio, Gallery, Image, Chat, Link, Quote, Aside, Status, Video.

@filename: sf-post-formats.php
@location: /includes
sf_get_post_media()
This function returns the media for the post based on the post format.
sf_get_post_format_image_src()
This function returns the featured image source for the Image post format.
sf_image_post()
This function returns the media for the Image post format.
sf_video_post()
This function returns the media for the Video post format.
sf_gallery_post()
This function returns the media for the Gallery post format.
sf_audio_post()
This function returns the media for the Audio post format.
sf_link_post()
This function returns the media for the Link post format.
sf_chat_post()
This function returns the media for the Chat post format.
sf_get_post_item()
This function outputs the full post item, including media, title, excerpt and details - based on the options and parameters passed to it.
sf_get_search_item()
This function outputs the search result item from the Post ID, shown on the search results page.

Portfolio

Dante has various portfolio options that allow you to configure the display for the portfolio page builder asset.

@filename: sf-portfolio.php
@location: /includes
sf_portfolio_items()
This function outputs portfolio items, based on a number of parameters such as blog type, category, and other options. This function is called from the Portfolio page builder asset, and the portfolio taxonomy archive page.
sf_portfolio_filter()
This function outputs the portfolio filter which is used to filter the portfolio on the fly, based on the categories used.

Products

Dante adds to the standard WooCommerce product display functionality, through the provided page builder assets.

@filename: sf-products.php
@location: /includes
sf_mini_product_items()
This function outputs mini product item lists, which feature a small thumbnail on the left, and the details on the right.
sf_product_items()
This function outputs products in the same display format as on the shop and category pages, but with the added functionality of being able to create carousels, and also sort the products based on various queries.

Media

@filename: sf-media.php
@location: /includes
sf_return_slider()
This function returns a rev slider object based on the shortcode. It is used within the page builder, as it's necessary to get a returned code for the slider, not echoed.
sf_video_embed()
This function is used to return YouTube/Vimeo embed code for video thumbnails.
sf_video_youtube()
This function returns the embed code for a YouTube video.
sf_video_vimeo()
This function returns the embed code for a Vimeo video.
sf_get_embed_src()
This function returns the video embed source for the fullscreen video overlay.
sf_featured_img_title()
This function returns the title attribute of the featured image for the current post.
sf_swift_slider()
This function outputs the swift slider, and contains the queries that returns the posts for the slides.

Formatting

Dante includes various functions to get the content in it's required form.

@filename: sf-formatting.php
@location: /includes
sf_get_the_content_with_formatting()
This function returns the post content with formatting.
sf_add_formatting()
This function adds default content formatting to a provided string parameter, and returns it.
sf_new_excerpt_length()
This function modifies the default WordPress excerpt length.
sf_excerpt()
This function returns the excerpt, limited in length by the provided limit parameter.
sf_content()
This function returns the content, limited in length by the provided limit parameter.
sf_custom_excerpt()
This function returns the custom excerpt, limited in length by the provided limit parameter.
sf_tag_cloud_args()
This function modifies the standard tag cloud widget arguments, to make all tags the same size.
sf_category_widget_mod()
This function modifies the standard category widget arguments, formatting the content to fit in with the theme styling.
sf_archives_widget_mod()
This function modifies the standard archive widget arguments, formatting the content to fit in with the theme styling.
sf_format_chat_content()
This function adds formatting to posts that are using the chat post format.
sf_format_chat_row_id()
This function adds a unique ID to each chat row.

Custom Styles

Custom styling is defined through the Theme Options and Live Color Customiser. These saved options are then applied to the theme via dynamic CSS.

@filename: sf-custom-styles.php
@location: /includes
sf_custom_styles()
This function outputs the custom css needed for the page into the head tag of the document. It is loaded here for speed and performance reasons.
sf_custom_script()
This function outputs the user's Custom JS, added through the theme options panel, before the end of the page.

Customizer

The live customizer that allows users to customise the theme on the fly, and then save their chosen options.

@filename: sf-customizer-options.php
@location: /includes
sf_customize_register()
This function registers the custom styles for the theme, the custom style options that are shown in the live customiser.
sf_customize_preview()
This function outputs some jQuery, which updates the live site elements with the new style options when they are changed. This is used to update the preview only, as a live example.

Theme Functions

@filename: sf-theme-functions.php
@location: /includes
sf_theme_activation()
This function redirects the user to the theme options panel upon theme activation.
sf_bwm_filter()
This function filters the Font Awesome and SS Gizmo files to exclude them from the files that are minified within the Better WordPress Minify plugin.
sf_bwm_ie_disable()
This function disables Better WordPress Minify on IE browsers, as it often causes more issues than good.
sf_filter_wp_title()
This function filters the Font Awesome and SS Gizmo files to exclude them from the files that are minified within the Better WordPress Minify plugin.
sf_maintenance_mode()
This function enables a maintenance mode message to show for users who are not logged in, and not admins. This can be enabled/disabled in the theme options.
sf_custom_login_logo()
This function replaces the WordPress login logo, with a custom image, which can be replaced within the theme options.
sf_breadcrumbs()
This function returns a breadcrumbs output for a post/page. It checks that the Breadcrumb NavXT plugin is installed, and falls back to the Yoast Breadcrumb plugin.
sf_language_flags()
This function outputs language flag options, based on the languages enabled within the WPML plugin. This is used within the theme header.
sf_hex2rgb()
This function converts a hex colour value, into RGB format.
sf_get_comments_number()
This function returns a comment string detailing the number of comments, from a provided Post ID.
sf_get_category_list()
This function returns an array of categories for a taxonomy.
sf_get_category_list_key_array()
This function returns a array of categories for a taxonomy, in key field array format.
sf_get_woo_product_filters_array()
This function returns returns an array of product filters, including category and custom attributes.
sf_add_nofollow_cat()
This function filters out the rel tag that is included within WordPress category links.
sf_remove_head_links()
This function removes certain head tags from the document head, for security purposes.
sf_global_include_classes()
This function adds classes to an element in the theme's footer, which enables the theme's jQuery functions to load only when needed.
sf_countdown_shortcode_locale()
This function adds localised strings for the countdown shortcode.
sf_admin_bar_menu()
This function adds two links to the WordPress Admin Bar, Theme Options and Color Customizer.
sf_admin_css()
This function adds css to the WordPress admin area for the custom post type icons.

Theme Options

The theme options for Dante are registered within this file. The options framework we use is Redux - click here to find out more.

@filename: sf-options.php
@location: /includes

Page Builder Assets

The page builder assets are shortcodes that are created through a class file. You can find the provided assets in /swift-framework/page-builder/builder/shortcodes/. If you would like to add/remove any assets from the page builder, you can do so by overriding the following function

@filename: spb-includes.php
@location: /swift-framework/page-builder/builder
if (!function_exists('spb_register_assets')) { function spb_register_assets() { require_once( SPB_SHORTCODES_DIR . 'default.php' ); require_once( SPB_SHORTCODES_DIR . 'column.php' ); require_once( SPB_SHORTCODES_DIR . 'accordion.php' ); require_once( SPB_SHORTCODES_DIR . 'tabs.php' ); require_once( SPB_SHORTCODES_DIR . 'tour.php' ); require_once( SPB_SHORTCODES_DIR . 'impact-text.php' ); require_once( SPB_SHORTCODES_DIR . 'media.php' ); require_once( SPB_SHORTCODES_DIR . 'raw_content.php' ); require_once( SPB_SHORTCODES_DIR . 'portfolio.php' ); require_once( SPB_SHORTCODES_DIR . 'blog.php' ); require_once( SPB_SHORTCODES_DIR . 'products.php' ); require_once( SPB_SHORTCODES_DIR . 'gallery.php' ); require_once( SPB_SHORTCODES_DIR . 'clients.php' ); require_once( SPB_SHORTCODES_DIR . 'full-width-text.php' ); require_once( SPB_SHORTCODES_DIR . 'team.php' ); require_once( SPB_SHORTCODES_DIR . 'jobs.php' ); require_once( SPB_SHORTCODES_DIR . 'testimonial.php' ); require_once( SPB_SHORTCODES_DIR . 'testimonial-carousel.php' ); require_once( SPB_SHORTCODES_DIR . 'testimonial-slider.php' ); require_once( SPB_SHORTCODES_DIR . 'faqs.php' ); require_once( SPB_SHORTCODES_DIR . 'revslider.php' ); require_once( SPB_SHORTCODES_DIR . 'recent-posts.php' ); require_once( SPB_SHORTCODES_DIR . 'parallax.php' ); require_once( SPB_SHORTCODES_DIR . 'portfolio-showcase.php' ); require_once( SPB_SHORTCODES_DIR . 'portfolio-carousel.php' ); require_once( SPB_SHORTCODES_DIR . 'posts-carousel.php' ); require_once( SPB_SHORTCODES_DIR . 'team-carousel.php' ); require_once( SPB_SHORTCODES_DIR . 'jobs-overview.php' ); require_once( SPB_SHORTCODES_DIR . 'code-snippet.php' ); require_once( SPB_SHORTCODES_DIR . 'googlechart.php' ); require_once( SPB_SHORTCODES_DIR . 'sitemap.php' ); require_once( SPB_SHORTCODES_DIR . 'search.php' ); require_once( SPB_SHORTCODES_DIR . 'supersearch.php' ); require_once( SPB_SHORTCODES_DIR . 'latest-tweets.php' ); require_once( SPB_SHORTCODES_DIR . 'tweets-slider.php' ); } if (is_admin()) { add_action('admin_init', 'spb_register_assets', 2); } if (!is_admin()) { add_action('wp', 'spb_register_assets', 2); } }