ID, 'elegant-magazine-meta-content-alignment', true); if (!empty($post_options)) { $page_layout = $post_options; } else { $page_layout = $global_layout; } } if (is_front_page() || is_home()) { $frontpage_layout = elegant_magazine_get_option('frontpage_content_alignment'); if (!empty($frontpage_layout)) { $page_layout = $frontpage_layout; } else { $page_layout = $global_layout; } } if ($page_layout == 'align-content-right') { if (!is_active_sidebar('home-sidebar-widgets') || !is_active_sidebar('sidebar-1')) { $classes[] = 'full-width-content ' . $disable_class; } else { $classes[] = 'align-content-right ' . $disable_class; } } elseif ($page_layout == 'full-width-content') { $classes[] = 'full-width-content ' . $disable_class; } else { if (!is_active_sidebar('home-sidebar-widgets')) { if ((is_home() || is_front_page()) && !is_active_sidebar('sidebar-1')) { $classes[] = 'full-width-content ' . $disable_class; } else { $classes[] = 'align-content-left ' . $disable_class; } } else { if (!is_active_sidebar('sidebar-1')) { $classes[] = 'full-width-content ' . $disable_class; } else { $classes[] = 'align-content-left ' . $disable_class; } } } return $classes; } add_filter( 'body_class', 'elegant_magazine_body_classes' ); /** * Add a pingback url auto-discovery header for singularly identifiable articles. */ function elegant_magazine_pingback_header() { if ( is_singular() && pings_open() ) { echo ''; } } add_action( 'wp_head', 'elegant_magazine_pingback_header' ); if (!function_exists('elegant_magazine_get_block')) : /** * * @since Elegant Magazine 1.0.0 * * @param null * @return null * */ function elegant_magazine_get_block( $block = 'full' ) { get_template_part('inc/hooks/blocks/block-post', $block); } endif; if (!function_exists('elegant_magazine_archive_title')) : /** * * @since Elegant Magazine 1.0.0 * * @param null * @return null * */ function elegant_magazine_archive_title($title) { if (is_category()) { $title = single_cat_title('', false); } elseif (is_tag()) { $title = single_tag_title('', false); } elseif (is_author()) { $title = '' . get_the_author() . ''; } elseif (is_post_type_archive()) { $title = post_type_archive_title('', false); } elseif (is_tax()) { $title = single_term_title('', false); } return $title; } add_filter('get_the_archive_title', 'elegant_magazine_archive_title'); endif; /* Display Breadcrumbs */ if ( ! function_exists( 'elegant_magazine_get_breadcrumb' ) ) : /** * Simple breadcrumb. * * @since 1.0.0 */ function elegant_magazine_get_breadcrumb() { $enable_breadcrumbs = elegant_magazine_get_option('enable_breadcrumb'); if ( 1 != $enable_breadcrumbs ) { return; } // Bail if Home Page. if ( is_front_page() || is_home() ) { return; } if ( ! function_exists( 'breadcrumb_trail' ) ) { /** * Load libraries. */ require_once get_template_directory() . '/lib/breadcrumbs/breadcrumbs.php'; } $breadcrumb_args = array( 'container' => 'div', 'show_browse' => false, ); ?>