/** * Custom body class * * @since Photo Perfect 1.0 */ function photo_perfect_custom_body_class($input) { // Site layout. $site_layout = photo_perfect_get_option('site_layout'); $input[] = 'site-layout-' . esc_attr($site_layout); // Archive layout. $archive_layout = photo_perfect_get_option('archive_layout'); $input[] = 'archive-layout-' . esc_attr($archive_layout); // Custom header status. $custom_header_status = get_header_image() ? 'enabled' : 'disabled'; $input[] = 'custom-header-' . $custom_header_status; // Global layout. global $post; $global_layout = photo_perfect_get_option('global_layout'); // Check if single. if ($post && is_singular()) { $post_options = get_post_meta($post->ID, 'theme_settings', true); if (isset($post_options['post_layout']) && !empty($post_options['post_layout'])) { $global_layout = $post_options['post_layout']; } } $input[] = 'global-layout-' . esc_attr($global_layout); return $input; }
/** * Load Archive Loop Content * * @since Photo Perfect 1.0 */ function photo_perfect_load_archive_loop_content() { $archive_layout = photo_perfect_get_option('archive_layout'); if ('masonry' === $archive_layout) { get_template_part('template-parts/content', 'masonry'); } else { if ('full' === $archive_layout) { get_template_part('template-parts/content', 'full'); } else { get_template_part('template-parts/content', get_post_format()); } } }
/** * Masonry End * * @since photo perfect 1.0 * */ function photo_perfect_add_masonry_wrap_end() { $archive_layout = photo_perfect_get_option('archive_layout'); if ('masonry' != $archive_layout) { return; } ?> </div><!-- #masonry-loop --></div><!-- .masonry-wrapper --><?php }