a template start

This commit is contained in:
Mark Moser 2018-07-18 08:03:46 -05:00
parent 0348bb3c42
commit 21062ca0a8
7 changed files with 110 additions and 18 deletions

View File

@ -1,5 +1,5 @@
+/* +/*
+Theme Name: My Fresh Wordpress Theme +Theme Name: ILDI
+Description: Something clever. +Description: Something clever.
+Author: markamoser +Author: markamoser
+Version: 1.0 +Version: 1.0

3
footer.php Normal file
View File

@ -0,0 +1,3 @@
<footer>
<?php ildi_nav('footer-menu'); ?>
</footer>

50
functions.php Normal file
View File

@ -0,0 +1,50 @@
<?php
if (function_exists('add_theme_support')) {
// add_theme_support('menus');
add_theme_support('post-thumbnails');
// add_image_size('large', 700, '', true);
// add_image_size('medium', 250, '', true);
// add_image_size('small', 120, '', true);
// add_image_size('custom-size', 700, 200, true); // call using the_post_thumbnail('custom-size');
add_theme_support('automatic-feed-links');
}
function ildi_nav($location='header-menu') {
wp_nav_menu(
array(
'theme_location' => $location,
'menu' => '',
'container' => '',
'container_class' => '',
'container_id' => '',
'menu_class' => $location,
'menu_id' => '',
'echo' => true,
'fallback_cb' => 'wp_page_menu',
'before' => '',
'after' => '',
'link_before' => '',
'link_after' => '',
'items_wrap' => '<ul class="%2$s">%3$s</ul>',
'depth' => 0,
'walker' => ''
)
);
}
function register_ildi_menus() {
register_nav_menus(array(
'header-menu' => __('Header Menu', 'ildi'),
'social-menu' => __('Social Links', 'ildi'),
'footer-menu' => __('Footer Menu', 'ildi')
));
}
// add_action('init', 'register_ildi_menu');
add_action( 'after_setup_theme', 'register_ildi_menus', 0 );
?>

13
globalHead.php Normal file
View File

@ -0,0 +1,13 @@
<header class="container">
<div class="logo-banner">
<a href="<?php echo home_url(); ?>">
<img src="<?php echo get_template_directory_uri(); ?>/img/logo.svg" alt="Destination Imaginaiton Illinois">
</a>
</div>
<?php ildi_nav(); ?>
<div class="search"></div>
<?php ildi_nav('social-menu'); ?>
</header>

16
header.php Normal file
View File

@ -0,0 +1,16 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="skype_toolbar" content="skype_toolbar_parser_compatible">
<meta charset="<?php bloginfo('charset'); ?>">
<title><?php wp_title(''); ?><?php if(wp_title('', false)) { echo ' :'; } ?> <?php bloginfo('name'); ?></title>
<meta name="description" content="<?php bloginfo('description'); ?>">
<link href="//www.google-analytics.com" rel="dns-prefetch">
<link href="<?php echo get_template_directory_uri(); ?>/img/icons/favicon.ico" rel="shortcut icon">
<link href="<?php echo get_template_directory_uri(); ?>/img/icons/touch.png" rel="apple-touch-icon-precomposed">
<?php wp_head(); ?>
</head>

View File

@ -1,19 +1,16 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html <?php language_attributes(); ?>>
<head> <?php get_header(); ?>
<meta charset="UTF-8">
<?php wp_head(); ?>
</head>
<body> <body>
<?php <a class="skip-nav sr-only" href="#main-content">Skip to main</a>
if ( have_posts() ) { <?php get_template_part('globalHead'); ?>
while ( have_posts() ) {
the_post(); <main id="main-content" role="main">
the_title( '<h1>', '</h1>' ); <?php get_template_part('loop'); ?>
the_content(); </main>
}
} <?php get_sidebar(); ?>
wp_footer();
?> <?php get_footer(); ?>
</body> </body>
</html> </html>

13
loop.php Normal file
View File

@ -0,0 +1,13 @@
<section>
<?php
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
the_title( '<h1>', '</h1>' );
the_content();
}
get_template_part('pagination');
}
?>
</section>