'/style.css',
'fontawesome' => '/fonts/fontawesome/css/all.min.css',
);
foreach ($styles as $handle => $file) {
wp_enqueue_style($handle, $theme_directory . $file, array(), '1', 'all');
}
}
add_action('wp_enqueue_scripts', 'enqueue_custom_styles');
// Theme Support
add_theme_support('post-thumbnails');
add_theme_support("title-tag");
add_theme_support('automatic-feed-links');
add_theme_support('html5', array(
'comment-list',
'comment-form',
'search-form',
'gallery',
'caption',
));
add_theme_support('align-wide');
add_theme_support('responsive-embeds');
function blog_layouts_enqueue_scripts()
{
// Load the wordpress comment script from the “\wordpress\wp-includes\js” directory.
// This allows the comment response form to be located below the corresponding comment
// and not at the very bottom of the page.
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
// Header Script
wp_enqueue_script('blog_layouts_header_script', get_template_directory_uri() . '/js/blog_layouts_header_script.js', null, '1.0', true);
// Author Script
if(get_theme_mod('author_page_latest_comments', true)) {
wp_enqueue_script('blog_layouts_author_script', get_template_directory_uri() . '/js/blog_layouts_author_page.js', null, '1.0', true);
}
}
add_action('wp_enqueue_scripts', 'blog_layouts_enqueue_scripts');
function blog_layouts_after_setup_theme()
{
// For the translation
load_theme_textdomain('blog-layouts', get_template_directory() . '/languages');
// defaults to the feed as the homepage
update_option('show_on_front', 'posts');
}
add_action('after_setup_theme', 'blog_layouts_after_setup_theme');
function blog_layouts_register_menus()
{
register_nav_menus(
array(
'header-menu' => __('Header Menu', 'blog-layouts'),
'footer-menu' => __('Footer Menu', 'blog-layouts')
)
);
}
add_action('init', 'blog_layouts_register_menus');
function blog_layouts_register_sidebar()
{
register_sidebar(array(
'name' => __('Sidebar', 'blog-layouts'),
'id' => 'my-sidebar',
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '',
));
}
add_action('widgets_init', 'blog_layouts_register_sidebar');
function blog_layouts_register_landigpage_widget_area()
{
register_sidebar(array(
'name' => __('Landingpage Widget Area', 'blog-layouts'),
'id' => 'landingpage-widget-area',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
));
}
add_action('widgets_init', 'blog_layouts_register_landigpage_widget_area');
// Custom menu structure
class blog_layouts_menu_walker extends Walker_Nav_Menu
{
function start_el(&$output, $item, $depth = 0, $args = [], $id = 0)
{
if (empty($item->title)) return;
$output .= "";
$output .= "";
}
}
// customizer settings
$customizer_options = [
'global-options.php',
'header-options.php',
'feed-options.php',
'posts-options.php',
'pages-options.php',
'author-page-options.php',
'searchresults-options.php',
'layout-options.php',
'post-list-layouts/cards-options.php',
'post-list-layouts/frameless-post-list.php',
'post-list-layouts/material2-post-list.php',
'post-list-layouts/material3-post-list.php',
'tag-list-options.php',
'category-list-options.php',
'date-list-options.php'
];
foreach ($customizer_options as $option) {
require_once get_template_directory() . '/customizer-options/' . $option;
}
// Sanitize function to check checkbox value (true/false)
function blog_layouts_sanitize_checkbox($input)
{
return (isset($input) && true === $input) ? true : false;
}
$blog_layouts_post_list_layouts = array(
'cards' => 'Cards',
'content-creator' => 'Content Creator',
'discover' => 'Discover',
'frameless' => 'Frameless',
'material2' => 'Material 2',
'material3' => 'Material 3',
'search-engine' => 'Search Engine',
'social' => 'Social',
);
$blog_layouts_sidebar_layouts = array(
'blocks' => 'Blocks',
'frameless' => 'Frameless',
'frames' => 'Frames',
'material2' => 'Material 2',
'material3' => 'Material 3',
'neon' => 'Neon',
'network' => 'Network',
'social' => 'Social',
'soft' => 'Soft',
);
$blog_layouts_chips_layouts = array(
'blocks' => 'Blocks',
'coder' => 'Coder',
'color-blocks' => 'Color Blocks',
'content-creator' => 'Content Creator',
'hashtag' => 'Hashtag',
'hub' => 'Hub',
'frames' => 'Frames',
'links' => 'Links',
'material2' => 'Material 2',
'material3' => 'Material 3',
'neon' => 'Neon',
'network' => 'Network',
'portal' => 'Portal',
'social' => 'Social',
);
$blog_layouts_header_layouts = array(
'coder' => 'Coder',
'gradient' => 'Gradient',
'material2' => 'Material 2',
'material3' => 'Material 3',
);
$blog_layouts_authorbox_layouts = array(
'border' => 'Border',
'frameless' => 'Frameless',
'neon' => 'Neon',
'material2' => 'Material 2',
'material3' => 'Material 3',
);
$blog_layouts_comments_layouts = array(
'dark-cards' => 'Dark Cards',
'frameless' => 'Frameless',
'material2' => 'Material 2',
'material3' => 'Material 3',
'neon' => 'Neon',
'portal' => 'Portal',
'social' => 'Social',
);