<?php
/**
 * Body Classes.
 * @package Green Nursery
 */

if (!function_exists('green_nursery_body_classes')) :

    function green_nursery_body_classes($green_nursery_classes)
    {
        $green_nursery_defaults = green_nursery_get_default_theme_options();
        $green_nursery_layout = green_nursery_get_final_sidebar_layout();

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

        // Sidebar layout logic
        $green_nursery_classes[] = $green_nursery_layout;

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

        return $green_nursery_classes;
    }

endif;

add_filter('body_class', 'green_nursery_body_classes');