<?php
/**
 * Body Classes.
 * @package Digital Media
 */

if (!function_exists('digital_media_body_classes')) :

    function digital_media_body_classes($digital_media_classes)
    {
        $digital_media_defaults = digital_media_get_default_theme_options();
        $digital_media_layout = digital_media_get_final_sidebar_layout();

        // Adds a class of hfeed to non-singular pages.
        if (!is_singular()) {
            $digital_media_classes[] = 'hfeed';
        }

        // Sidebar layout logic
        $digital_media_classes[] = $digital_media_layout;

        // Copyright alignment
        $copyright_alignment = get_theme_mod('digital_media_copyright_alignment', 'Default');
        $digital_media_classes[] = 'copyright-' . strtolower($copyright_alignment);

        return $digital_media_classes;
    }

endif;

add_filter('body_class', 'digital_media_body_classes');