Finish front page

This commit is contained in:
Monika Eftimova 2014-10-04 23:54:46 +03:00
parent 78c78cfc3e
commit 11da238fef
2 changed files with 87 additions and 27 deletions

View File

@ -1,5 +1,5 @@
<?php get_header(); ?> <?php get_header(); ?>
<section id="content" role="main" class="front-page content grid"> <section class="content grid">
<?php <?php
/* /*
if ( have_posts() ) : while ( have_posts() ) : the_post(); if ( have_posts() ) : while ( have_posts() ) : the_post();
@ -9,32 +9,75 @@
get_template_part( 'nav', 'below' ); get_template_part( 'nav', 'below' );
*/ */
?> ?>
<div class="col2"> <div class="col2">
<h1></h1> <h1><?php echo get_bloginfo('name'); ?> </h1>
<p></p> <p><?php echo get_bloginfo('description'); ?></p>
</div> </div>
<div class="col2"> <div class="col2">
<h3><?php echo __( 'Sponsors' ); ?></h3> <h3>Спонсори</h3>
<?php <?php
$args = array( 'post_type' => 'sponsors', 'orderby' => 'rand' ); $sponsors_args = array( 'post_type' => 'sponsors', 'orderby' => 'rand' );
$the_query = new WP_Query( $args ); $sponsors = new WP_Query( $sponsors_args );
if ( $the_query->have_posts() ) : if ( $sponsors->have_posts() ) :
while ( $the_query->have_posts() ) : $the_query->the_post(); while ( $sponsors->have_posts() ) : $sponsors->the_post();
if ( has_post_thumbnail() ) { if ( has_post_thumbnail() ) {
?> ?>
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a> <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>
<?php <?php
} else { } else {
?> ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<?php <?php
} }
endwhile; endwhile;
wp_reset_postdata(); endif;
endif; ?>
?> </div>
</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,5 +1,4 @@
<?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'),
@ -118,4 +117,22 @@ function create_sponsors_posttype() {
add_action( 'init', create_sponsors_posttype ); add_action( 'init', create_sponsors_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' );
?> ?>