<?php
/**
 * Body Classes.
 * @package Local Supermarket
 */

if (!function_exists('local_supermarket_body_classes')) :

    function local_supermarket_body_classes($local_supermarket_classes)
    {
        $local_supermarket_defaults = local_supermarket_get_default_theme_options();
        $local_supermarket_layout = local_supermarket_get_final_sidebar_layout();

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

        // Sidebar layout logic
        $local_supermarket_classes[] = $local_supermarket_layout;

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

        return $local_supermarket_classes;
    }

endif;

add_filter('body_class', 'local_supermarket_body_classes');