Merge pull request #1 from plazmonii/structure-fixes-and-additions

Structure fixes and additions
This commit is contained in:
Vasil Kolev 2014-10-05 20:21:53 +03:00
commit dcf4094546
14 changed files with 501 additions and 171 deletions

View File

@ -235,16 +235,17 @@ nav ul {
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
nav ul > li { nav ul li {
position: relative;
}
nav .menu > li {
float: left; float: left;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
nav ul a {
color: #000; nav .menu > li {
text-decoration: none;
display: block;
padding: 1.5em 0.4em;
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
-moz-box-sizing: border-box; -moz-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
@ -252,9 +253,40 @@ nav ul a {
-webkit-transition: border-top 200ms; -webkit-transition: border-top 200ms;
border-top: 0 solid #FFF; border-top: 0 solid #FFF;
} }
nav ul a:hover {
nav .menu > li:hover {
border-top: 0.4em solid #A8D6FF; border-top: 0.4em solid #A8D6FF;
} }
nav ul a {
color: #000;
text-decoration: none;
display: block;
padding: 1.5em 0.4em;
}
nav ul .sub-menu {
display: none;
position: absolute;
background: #fff;
width: 200px;
left: 50%;
margin-left: -100px;
box-shadow: 0 3px 5px -3px #000
}
nav ul li:hover .sub-menu {
display: block;
position: absolute;
}
nav ul .sub-menu li,
nav ul .sub-menu li a { display: block; width: 100%; }
nav ul .sub-menu li a { padding: 1em 0; text-align: center; }
nav ul .sub-menu li { border-bottom: 1px solid #ccc; }
nav ul .separator { nav ul .separator {
display: block; display: block;
width: 0.05em; width: 0.05em;
@ -424,6 +456,12 @@ footer {
background: #ddd; background: #ddd;
} }
footer .content li { list-style: none; }
#copyright {
text-align: center;
}
/* Sub navigation */ /* Sub navigation */
.subnav { .subnav {
margin-top: 1.6em; margin-top: 1.6em;
@ -462,9 +500,9 @@ footer {
float: left; float: left;
padding: 0.3em; padding: 0.3em;
background: #FFF; background: #FFF;
-moz-box-shadow: 0px 0px 1px 1px #999; -moz-box-shadow: 0px 0px 1px 1px #999;
-webkit-box-shadow: 0px 0px 1px 1px #999; -webkit-box-shadow: 0px 0px 1px 1px #999;
box-shadow: 0px 0px 1px 1px #999; box-shadow: 0px 0px 1px 1px #999;
margin: 0 1em 2em 0; margin: 0 1em 2em 0;
} }
.speaker .icons { .speaker .icons {
@ -491,4 +529,5 @@ footer {
.sponsors-item .col2 > img { .sponsors-item .col2 > img {
display: inline-block; display: inline-block;
margin: 0 0 2em 0; margin: 0 0 2em 0;
} }

View File

@ -1,9 +1,9 @@
<section class="entry-content"> <section class="entry-content">
<?php <?php
if ( has_post_thumbnail() ) { if ( has_post_thumbnail() ) {
the_post_thumbnail(); the_post_thumbnail();
} }
?> ?>
<?php the_content(); ?> <?php the_content(); ?>
<div class="entry-links"><?php wp_link_pages(); ?></div> <div class="entry-links"><?php wp_link_pages(); ?></div>
</section> </section>

View File

@ -1,9 +1,9 @@
<footer class="entry-footer"> <footer class="entry-footer">
<span class="cat-links"><?php _e( 'Categories: ', 'blankslate' ); ?><?php the_category( ', ' ); ?></span> <span class="cat-links"><?php _e( 'Categories: ', 'blankslate' ); ?><?php the_category( ', ' ); ?></span>
<span class="tag-links"><?php the_tags(); ?></span> <span class="tag-links"><?php the_tags(); ?></span>
<?php <?php
if ( comments_open() ) { if ( comments_open() ) {
echo '<span class="meta-sep">|</span> <span class="comments-link"><a href="' . get_comments_link() . '">' . sprintf( __( 'Comments', 'initfest' ) ) . '</a></span>'; echo '<span class="meta-sep">|</span> <span class="comments-link"><a href="' . get_comments_link() . '">' . sprintf( __( 'Comments', 'initfest' ) ) . '</a></span>';
} }
?> ?>
</footer> </footer>

View File

@ -1,5 +1,5 @@
<section class="entry-meta"> <section class="entry-meta">
<span class="author vcard"><?php the_author_posts_link(); ?></span> <span class="author vcard"><?php the_author_posts_link(); ?></span>
<span class="meta-sep"> | </span> <span class="meta-sep"> | </span>
<span class="entry-date"><?php the_time( get_option( 'date_format' ) ); ?></span> <span class="entry-date"><?php the_time( get_option( 'date_format' ) ); ?></span>
</section> </section>

View File

@ -1,6 +1,6 @@
<section class="entry-summary"> <section class="entry-summary">
<?php the_excerpt(); ?> <?php the_excerpt(); ?>
<?php if( is_search() ) { ?> <?php if( is_search() ) { ?>
<div class="entry-links"><?php wp_link_pages(); ?></div <div class="entry-links"><?php wp_link_pages(); ?></div
><?php } ?> ><?php } ?>
</section> </section>

View File

@ -1,16 +1,16 @@
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header> <header>
<?php <?php
if ( is_singular() ) { if ( is_singular() ) {
echo '<h1 class="entry-title">'; echo '<h1 class="entry-title">';
} else { } else {
echo '<h2 class="entry-title">'; echo '<h2 class="entry-title">';
} ?> } ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark"><?php the_title(); ?></a> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark"><?php the_title(); ?></a>
<?php if ( is_singular() ) { echo '</h1>'; } else { echo '</h2>'; } ?> <?php if ( is_singular() ) { echo '</h1>'; } else { echo '</h2>'; } ?>
<?php edit_post_link(); ?> <?php edit_post_link(); ?>
<?php if ( !is_search() && !is_page() && !is_front_page()) get_template_part( 'entry', 'meta' ); ?> <?php if ( !is_search() && !is_page() && !is_front_page()) get_template_part( 'entry', 'meta' ); ?>
</header> </header>
<?php get_template_part( 'entry', ( is_archive() || is_search() ? 'summary' : 'content' ) ); ?> <?php get_template_part( 'entry', ( is_archive() || is_search() ? 'summary' : 'content' ) ); ?>
<?php if ( !is_search() && !is_page() && !is_front_page()) get_template_part( 'entry-footer' ); ?> <?php if ( !is_search() && !is_page() && !is_front_page()) get_template_part( 'entry-footer' ); ?>
</article> </article>

View File

@ -1,36 +1,36 @@
<div class="clear"></div> <div class="clear"></div>
<footer> <footer>
<div class="content grid"> <div class="content grid">
<div class="col4"> <div class="col4">
<h3>OpenFest</h3> <h3>OpenFest</h3>
<p> <p>
<?php wp_nav_menu(array('theme_location' => 'footer-openfest', 'items_wrap' => '%3$s<br/>' )); ?> <?php wp_nav_menu(array('theme_location' => 'footer-openfest', 'items_wrap' => '%3$s<br/>' )); ?>
</p> </p>
</div> </div>
<div class="col4"> <div class="col4">
<h3>Програма</h3> <h3>Програма</h3>
<p> <p>
<?php wp_nav_menu(array('theme_location' => 'footer-schedule', 'items_wrap' => '%3$s<br/>' )); ?> <?php wp_nav_menu(array('theme_location' => 'footer-schedule', 'items_wrap' => '%3$s<br/>' )); ?>
</p> </p>
</div> </div>
<div class="col4"> <div class="col4">
<h3>Други</h3> <h3>Други</h3>
<p> <p>
<?php wp_nav_menu(array('theme_location' => 'footer-others', 'items_wrap' => '%3$s<br/>' )); ?> <?php wp_nav_menu(array('theme_location' => 'footer-others', 'items_wrap' => '%3$s<br/>' )); ?>
</p> </p>
</div> </div>
<div class="col4"> <div class="col4">
<h3>Последвайте ни в:</h3> <h3>Последвайте ни в:</h3>
<p> <p>
<?php wp_nav_menu(array('theme_location' => 'footer-followus', 'items_wrap' => '%3$s<br/>' )); ?> <?php wp_nav_menu(array('theme_location' => 'footer-followus', 'items_wrap' => '%3$s<br/>' )); ?>
</p> </p>
</div> </div>
</div> </div>
<div id="copyright"> <div id="copyright">
<?php echo sprintf( __( '%1$s %2$s %3$s. Some Rights Reserved.', 'initfest' ), '&copy;', date( 'Y' ), esc_html( get_bloginfo( 'name' ) ) ); ?> <?php echo sprintf( __( '%1$s %2$s %3$s. Some Rights Reserved.', 'initfest' ), '&copy;', date( 'Y' ), esc_html( get_bloginfo( 'name' ) ) ); ?>
</div> </div>
</footer> </footer>
<?php wp_footer(); ?> <?php wp_footer(); ?>
</body> </body>
</html> </html>

View File

@ -1,10 +1,66 @@
<?php get_header(); ?> <?php get_header(); ?>
<section id="content" role="main"> <section class="content grid">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php
<?php get_template_part( 'entry' ); ?> /*
<?php comments_template(); ?> if ( have_posts() ) : while ( have_posts() ) : the_post();
<?php endwhile; endif; ?> get_template_part( 'entry' );
<?php get_template_part( 'nav', 'below' ); ?> comments_template();
endwhile; endif;
get_template_part( 'nav', 'below' );
*/
?>
<div class="col2">
<h1><?php echo get_bloginfo('name'); ?> </h1>
<p><?php echo get_bloginfo('description'); ?></p>
</div>
<div class="col2">
<h3>Спонсори</h3>
<?php echo do_shortcode( '[sponsors]' ); ?>
</div>
</section> </section>
<div class="separator"></div>
<section class="content">
<h3>Новини | <small><a href="">виж всички новини</a></small></h3>
<div class="grid">
<?php
$news_args = array( 'cat' => 5, posts_per_page => 3 );
$news = new WP_Query( $news_args );
if ( $news->have_posts() ) :
while ( $news->have_posts() ) : $news->the_post();
?>
<div class="col3">
<h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
<p class="info">От <?php the_author(); ?> | Публикувано на <?php the_date(); ?> </p>
<?php the_excerpt(); ?>
<a class="button" href="<?php the_permalink(); ?>">виж цялата новина</a>
</div>
<?php
endwhile;
endif;
?>
</div>
</section>
<div class="separator"></div>
<section class="content grid">
<h3>Място: Интерпред, София, България</h3>
<?php
$transport_args = array( 'post_type' => 'transportation' );
$transport = new WP_Query( $transport_args );
if ( $transport->have_posts() ) :
while ( $transport->have_posts() ) : $transport->the_post();
?>
<p><?php the_title(); ?> <br /> <?php the_content(); ?></p>
<?php
endwhile;
endif;
?>
</section>
<?php get_sidebar(); ?> <?php get_sidebar(); ?>
<?php get_footer(); ?> <?php get_footer(); ?>

View File

@ -1,53 +1,52 @@
<?php <?php
register_nav_menus( register_nav_menus(
array( 'main-menu' => __( 'Main Menu', 'initfest' ), array( 'main-menu' => __( 'Main Menu', 'initfest' ),
'footer-openfest' => __('OpenFest', 'initfest'), 'footer-openfest' => __('OpenFest', 'initfest'),
'footer-openfest' => __('OpenFest', 'initfest'), 'footer-openfest' => __('OpenFest', 'initfest'),
'footer-schedule' => __('Schedule', 'initfest'), 'footer-schedule' => __('Schedule', 'initfest'),
'footer-others' => __('Others', 'initfest'), 'footer-others' => __('Others', 'initfest'),
'footer-followus' => __('Follow us in:', 'initfest') ) 'footer-followus' => __('Follow us in:', 'initfest') )
); );
add_shortcode('sh-latest-posts', 'sh_latest_posts'); add_shortcode('sh-latest-posts', 'sh_latest_posts');
function sh_latest_posts($atts){ function sh_latest_posts($atts){
$atts = shortcode_atts( array( $atts = shortcode_atts( array(
'cat' => 'news', 'cat' => 'news',
'label' => __('News', 'initfest') 'label' => __('News', 'initfest')
), $atts ); ), $atts );
$result = '<div class="separator"></div><section class="content"><h3>'.$atts['label'].' | <small><a href="'.esc_url(get_term_link($atts['cat'], 'category')).'">'.__('see all', 'initfest').'</a></small></h3>'; $result = '<div class="separator"></div><section class="content"><h3>'.$atts['label'].' | <small><a href="'.esc_url(get_term_link($atts['cat'], 'category')).'">'.__('see all', 'initfest').'</a></small></h3>';
ob_start(); ob_start();
?> ?>
<div class="grid"> <div class="grid">
<div class="col3"> <div class="col3">
<h4>Разходи за OpenFest 2013</h4> <h4>Разходи за OpenFest 2013</h4>
<p class="info">От HACKMAN | Публикувано на: 13.11.2013</p> <p class="info">От HACKMAN | Публикувано на: 13.11.2013</p>
<p>4913.05 Зали, озвучаване и техника за презентиране<br /> <p>4913.05 Зали, озвучаване и техника за презентиране<br />
2265.07 Тениски за посетители, екип и доброволци<br /> 2265.07 Тениски за посетители, екип и доброволци<br />
673.18 Разходи за вода, чай, кафе, вафли, разколнители, канцеларски материали<br /> 673.18 Разходи за вода, чай, кафе, вафли, разколнители, канцеларски материали<br />
2442.00 Транспорт, хотел и вечеря за лекторите<br /> 2442.00 Транспорт, хотел и вечеря за лекторите<br />
397.00 Закуска и обяд за екипа в двата дни ...</p> 397.00 Закуска и обяд за екипа в двата дни ...</p>
<a href="#" class="button">виж цялата новина</a> <a href="#" class="button">виж цялата новина</a>
</div> </div>
<div class="col3"> <div class="col3">
<h4>2013 Network Stats</h4> <h4>2013 Network Stats</h4>
<p class="info">От HACKMAN | Публикувано на: 13.11.2013</p> <p class="info">От HACKMAN | Публикувано на: 13.11.2013</p>
<p>Удостоверили и сме им раздали 1841 уникални потребителски IP версия 4 <p>Удостоверили и сме им раздали 1841 уникални потребителски IP версия 4
адреси и 1356 IPv6 адреси!<br />Максимума едновременно работещи потребители върху всичките 4 AP-та е 326 адреси и 1356 IPv6 адреси!<br />Максимума едновременно работещи потребители върху всичките 4 AP-та е 326
устройства и е направен на 2.11.2013 в 15:33 устройства и е направен на 2.11.2013 в 15:33
Зала Варна 2.4GHz 11ng = 44 Зала Варна 2.4GHz 11ng = 44
Лоби 2.4GHz 11ng = 85 ...</p> Лоби 2.4GHz 11ng = 85 ...</p>
<a href="#" class="button">виж цялата новина</a> <a href="#" class="button">виж цялата новина</a>
</div> </div>
<div class="col3"> <div class="col3">
<h4>Статистика за Бирата</h4> <h4>Статистика за Бирата</h4>
<p class="info">От HACKMAN | Публикувано на: 13.11.2013</p> <p class="info">От HACKMAN | Публикувано на: 13.11.2013</p>
<p>418х Старопрамен наливно 0.500мл<br /> <p>418х Старопрамен наливно 0.500мл<br />
97х Каменица 0.500мл<br /> 97х Каменица 0.500мл<br />
62х Бекс<br /> 62х Бекс<br />
48х Старопрамен бутилка 0.500мл<br /> 48х Старопрамен бутилка 0.500мл<br />
@ -58,16 +57,159 @@ function sh_latest_posts($atts){
23х Гинес<br /> 23х Гинес<br />
23х ХопГоблин<br /> 23х ХопГоблин<br />
13х Трупър ...</p> 13х Трупър ...</p>
<a href="#" class="button">виж цялата новина</a> <a href="#" class="button">виж цялата новина</a>
</div> </div>
</div> </div>
</section> </section>
<div class="separator"></div> <div class="separator"></div>
<?php <?php
$result .= ob_get_contents(); $result .= ob_get_contents();
ob_end_clean(); ob_end_clean();
return $result; return $result;
} }
# Add support for thumbnais
add_theme_support( 'post-thumbnails' );
# Create a custom post type for Sponsors
function create_sponsors_posttype() {
$labels = array(
'name' => __( 'Sponsors' ),
'singular_name' => __( 'Sponsor' ),
'menu_name' => __( 'Sponsors'),
'all_items' => __( 'All Sponsors' ),
'view_item' => __( 'View Sponsor' ),
'add_new_item' => __( 'Add New Sponsor' ),
'add_new' => __( 'Add New' ),
'edit_item' => __( 'Edit Sponsor' ),
'update_item' => __( 'Update Sponsor' ),
'search_item' => __( 'Search Sponsor' ),
'not_found' => __( 'Not Found' ),
'not_found_in_trash' => __( 'Not Found In Trash' ),
);
$args = array(
'label' => __( 'sponsors' ),
'description' => __( 'Sponsors of OpenFest' ),
'labels' => $labels,
'supports' => array( 'title', 'excerpt', 'thumbnail', 'custom-fields', ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 5,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'post',
);
register_post_type( 'sponsors', $args );
}
add_action( 'init', create_sponsors_posttype );
# Create a custom post type for Speakers
function create_speakers_posttype() {
$labels = array(
'name' => __( 'Speakers' ),
'singular_name' => __( 'Speaker' ),
'menu_name' => __( 'Speakers'),
'all_items' => __( 'All Speakers' ),
'view_item' => __( 'View Speaker' ),
'add_new_item' => __( 'Add New Speaker' ),
'add_new' => __( 'Add New' ),
'edit_item' => __( 'Edit Speaker' ),
'update_item' => __( 'Update Speaker' ),
'search_item' => __( 'Search Speaker' ),
'not_found' => __( 'Not Found' ),
'not_found_in_trash' => __( 'Not Found In Trash' ),
);
$args = array(
'label' => __( 'speakers' ),
'description' => __( 'Speakers on OpenFest' ),
'labels' => $labels,
'supports' => array( 'title', 'excerpt', 'thumbnail', 'custom-fields', ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 6,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'post',
);
register_post_type( 'speakers', $args );
}
add_action( 'init', create_speakers_posttype );
# Create a custom post type for Tranportation
function transportation_posttype() {
register_post_type( 'transportation',
array(
'labels' => array(
'name' => __( 'Tranportation' ),
),
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'transportation'),
)
);
}
add_action( 'init', 'transportation_posttype' );
# Create shortcode for sponsors
function sponsors_shortcode() {
global $post;
$output = '';
$sponsors_args = array( 'post_type' => 'sponsors', 'orderby' => 'rand' );
$sponsors = new WP_Query( $sponsors_args );
if ( $sponsors->have_posts() ) :
while ( $sponsors->have_posts() ) : $sponsors->the_post();
if ( has_post_thumbnail() ) {
$output .= the_post_thumbnail();
} else {
$output .= get_the_title();
}
endwhile;
endif;
return $output;
}
# Register all shortcodes
function register_shortcodes(){
add_shortcode('sponsors', 'sponsors_shortcode');
}
add_action( 'init', 'register_shortcodes');
?>

View File

@ -9,29 +9,29 @@
<meta name="robots" content="follow,index" /> <meta name="robots" content="follow,index" />
<meta name="title" content="" /> <meta name="title" content="" />
<meta name="keywords" content="" lang="en-us" /> <meta name="keywords" content="" lang="en-us" />
<meta name="description" content="" /> <meta name="description" content="" />
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0" /> <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<link rel="icon" type="image/png" href=""> <link rel="icon" type="image/png" href="">
<title><?php wp_title( ' | ', true, 'right' ); ?></title> <title><?php wp_title( ' | ', true, 'right' ); ?></title>
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_uri(); ?>" /> <link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_uri(); ?>" />
<?php wp_head(); ?> <?php wp_head(); ?>
</head> </head>
<body> <body>
<nav> <nav>
<div class="content cf"> <div class="content cf">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="logo"><img src="<?php echo get_template_directory_uri(); ?>/img/logo.png" alt="OpenFest" /></a> <a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="logo"><img src="<?php echo get_template_directory_uri(); ?>/img/logo.png" alt="OpenFest" /></a>
<?php wp_nav_menu( array('theme_location' => 'main-menu') ); ?> <?php wp_nav_menu( array('theme_location' => 'main-menu') ); ?>
</div> </div>
</nav> </nav>
<?php <?php
if(is_front_page()){ if(is_front_page()){
echo '<section class="banner cf"><img src="'.get_template_directory_uri().'/img/banner.png" alt="" /></section>'; echo '<section class="banner cf"><img src="'.get_template_directory_uri().'/img/banner.png" alt="" /></section>';
} }
?> ?>

View File

@ -1,10 +1,10 @@
<?php get_header(); ?> <?php get_header(); ?>
<section id="content" role="main"> <section id="content" role="main" class="content">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'entry' ); ?> <?php get_template_part( 'entry' ); ?>
<?php comments_template(); ?> <?php comments_template(); ?>
<?php endwhile; endif; ?> <?php endwhile; endif; ?>
<?php get_template_part( 'nav', 'below' ); ?> <?php get_template_part( 'nav', 'below' ); ?>
</section> </section>
<?php get_sidebar(); ?> <?php get_sidebar(); ?>
<?php get_footer(); ?> <?php get_footer(); ?>

View File

@ -0,0 +1,42 @@
<?php
/*
Template Name: Speakers
*/
get_header(); ?>
<div class="separator"></div>
<section class="content grid">
<div class="col-left">
<h1 class="big">Лектори</h1>
<?php
$speakers_args = array( 'post_type' => 'speakers' );
$speakers = new WP_Query( $speakers_args );
if ( $speakers->have_posts() ) :
while ( $speakers->have_posts() ) : $speakers->the_post();
?>
<div class="speaker">
<?php
if ( has_post_thumbnail() ) {
the_post_thumbnail();
} else {
?>
<img src="img/speakers.jpg">
<?php
}
?>
<h3><?php the_title(); ?></h3>
<?php
the_content();
?>
</div>
<?php
endwhile;
wp_reset_postdata();
endif;
?>
</div>
<div class="col-right"><?php get_sidebar(); ?></div>
</section>
<?php get_footer(); ?>

View File

@ -0,0 +1,51 @@
<?php
/*
Template Name: Sponsors
*/
get_header(); ?>
<section class="content">
<?php
if ( have_posts() ) : while ( have_posts() ) : the_post();
the_content();
endwhile; endif;
?>
</section>
<div class="separator"></div>
<section class="content grid sponsors-item">
<?php
$sponsors_args = array( 'post_type' => 'sponsors', 'orderby' => 'rand' );
$sponsors = new WP_Query( $sponsors_args );
$sponsor_count = 0;
if ( $sponsors->have_posts() ) :
while ( $sponsors->have_posts() ) : $sponsors->the_post();
?>
<div class="col2 tac">
<?php
if ( has_post_thumbnail() ) {
the_post_thumbnail();
} else {
the_title();
}
the_content();
?>
</div>
<?php
$sponsor_count++;
if ($sponsor_count % 2 == 0) {
?>
</section>
<section class="content grid sponsors-item">
<?php
}
endwhile;
wp_reset_postdata();
endif;
?>
</section>
<?php get_footer(); ?>

View File

@ -1,10 +1,10 @@
<?php get_header(); ?> <?php get_header(); ?>
<section id="content" role="main"> <section id="content" role="main">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'entry' ); ?> <?php get_template_part( 'entry' ); ?>
<?php //comments_template(); NO COMMENTS IN PAGES PLEASE ?> <?php //comments_template(); NO COMMENTS IN PAGES PLEASE ?>
<?php endwhile; endif; ?> <?php endwhile; endif; ?>
<?php //get_template_part( 'nav', 'below' ); ?> <?php //get_template_part( 'nav', 'below' ); ?>
</section> </section>
<?php get_sidebar(); ?> <?php get_sidebar(); ?>
<?php get_footer(); ?> <?php get_footer(); ?>