<?php
/**
* Template name: Homepage
*/
get_header(); ?>
<div id="primary">
<div id="content" role="main">
<div class="astro"><img class="astro" src="<?php echo get_template_directory_uri() . '/images/astro.png'; ?>" alt="Astro" />
</div>
<?php if ( ! dynamic_sidebar( 'sidebar-8' ) ) : ?>
<div id="gallery-homepage">
<?php echo do_shortcode('[jj-ngg-jquery-slider title="" gallery="1" html_id="about-slider" width="906" height="358" controlnav="0" pausetime="6000" captionopacity="0.6" effect="fade" center="1"]') ?>
</div>
<?php endif; ?>
<div class="planet"><img class="planet" src="<?php echo get_template_directory_uri() . '/images/planet.png'; ?>" alt="Planet" />
</div>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
$page = get_page_by_title( 'About' );
$the_excerpt = $page->post_excerpt;
$page_data = get_page( $page );
$title = $page_data->post_title;
?>
<header class="entry-header">
<h1 class="entry-title">
<a href="<?php echo esc_url( get_permalink( get_page_by_title( 'About' ) ) ); ?>">
<?php echo $page_data->post_title; ?>
</a>
</h1>
</header>
<div class="entry-content"><?php echo $page->post_excerpt; ?>
<!--<a href="<?php echo esc_url( get_permalink( get_page_by_title( 'About' ) ) ); ?>">more +</a>-->
</div>
</article>
<div id="tour-center">
<header class="entry-header">
<?php if ( ! dynamic_sidebar( 'sidebar-6' ) ) : ?>
<aside id="gallery" class="widget">
<ul>
<?php echo nggShowSlideshow(2,265,175); ?>
</ul>
</aside>
<?php endif; ?>
</header>
</div>
<div id="news-section-title">
<header class="entry-header">
<h1 class="entry-title">
<a href="<?php echo esc_url( get_permalink( get_page_by_title( 'Challenger News' ) ) ); ?>">
<?php
$page = get_page_by_title( 'Challenger News' );
$page_data = get_page( $page );
$title = $page_data->post_title;
?>
<?php echo $page_data->post_title; ?>
</a>
</h1>
</header>
<div class="hr"></div>
</div>
<div class="news">
<div class="rss-news">
<a href="http://nelsonandco.pro/learncenter/category/happenings/feed"><img src="<?php echo get_template_directory_uri() . '/images/rss.png'; ?>" alt="RSS" />
</a>
</div>
<?php
$post_from_cat_a = new WP_Query(array(
'category_name' => 'happenings', //Get posts from category a
'posts_per_page'=> 2 //Limit it to the latest one
));
if( $post_from_cat_a->have_posts() ){
while( $post_from_cat_a->have_posts() ): $post_from_cat_a->the_post();
//Display output here for post from category a
$category = get_the_category();
if($category[0]){
echo '<div class="cat-link"><a href="'.get_category_link($category[0]->term_id ).'">'.$category[0]->cat_name.'</a></div>';
}
get_template_part( 'content', 'homepage' );
endwhile;
wp_reset_postdata();
}
?>
</div>
<div class="news">
<div class="rss-news">
<a href="http://nelsonandco.pro/learncenter/category/in-the-news/feed"><img src="<?php echo get_template_directory_uri() . '/images/rss.png'; ?>" alt="RSS" />
</a>
</div>
<?php
$post_from_cat_a = new WP_Query(array(
'category_name' => 'in-the-news', //Get posts from category a
'posts_per_page'=> 2 //Limit it to the latest one
));
if( $post_from_cat_a->have_posts() ){
while( $post_from_cat_a->have_posts() ): $post_from_cat_a->the_post();
//Display output here for post from category a
$category = get_the_category();
if($category[0]){
echo '<div class="cat-link"><a href="'.get_category_link($category[0]->term_id ).'">'.$category[0]->cat_name.'</a></div>';
}
get_template_part( 'content', 'homepage' );
endwhile;
wp_reset_postdata();
}
?>
</div>
<div class="news">
<div class="rss-news">
<a href="http://nelsonandco.pro/learncenter/category/press/feed"><img src="<?php echo get_template_directory_uri() . '/images/rss.png'; ?>" alt="RSS" />
</a>
</div>
<?php
$post_from_cat_a = new WP_Query(array(
'category_name' => 'press', //Get posts from category a
'posts_per_page'=> 2 //Limit it to the latest one
));
if( $post_from_cat_a->have_posts() ){
while( $post_from_cat_a->have_posts() ): $post_from_cat_a->the_post();
//Display output here for post from category a
$category = get_the_category();
if($category[0]){
echo '<div class="cat-link"><a href="'.get_category_link($category[0]->term_id ).'">'.$category[0]->cat_name.'</a></div>';
}
get_template_part( 'content', 'homepage' );
endwhile;
wp_reset_postdata();
}
?>
</div>
<div class="events">
<?php
$post_from_cat_a = new WP_Query(array(
'category_name' => 'events', //Get posts from category a
'posts_per_page'=> 2, //Limit it to the latest one
'ignore_sticky_posts' => 0
));
if( $post_from_cat_a->have_posts() ){
while( $post_from_cat_a->have_posts() ): $post_from_cat_a->the_post();
//Display output here for post from category a
$category = get_the_category();
if($category[0]){
echo '<div class="cat-events"><a href="'.get_category_link($category[0]->term_id ).'">'.$category[0]->cat_name.'</a></div>';
}
get_template_part( 'content', 'events' );
endwhile;
wp_reset_postdata();
}
?>
</div>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?>