Home Page Code Get Custom Post

<?php
/**
* Template Name: Home Page Template
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other ‘pages’ on your WordPress site will use a
* different template.
*
* @package Electric Generation WordPress Theme
*/

get_header(); ?>
<div class=”slider-sec”>
<ul class=”slide”>
<?php  $args = array( ‘post_type’ => ‘slider_articles’, ‘posts_per_page’ => 10);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();  ?>
<?php $feat_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); ?>
<li><img src=”<?php echo $feat_image; ?>” alt=”<?php the_title(); ?>” />
<section class=”slide-details”>
<div class=”wrapper”>
<div class=”content”>
<a href=”<?php the_permalink(); ?>”>
<h3><?php the_title(); ?></h3>
<p><?php echo excerpt(12); ?>>></p>
</a>
</div>
</div>
</section>
</li>
<?php endwhile;  ?>
<?php wp_reset_query(); ?>

</ul>
</div>
<!————carousel——————–>
<!————carousel——————–>
<section class=”crowsal_sec”>
<div class=”wrapper”>
<div id=”demo”>
<div class=”container”>

<div class=”span12″>
<h2>News &amp; Articles</h2>
</div>
</div>

<div class=”inner-crowsal”>
<div class=”span12″>

<div id=”owl-example” class=”owl-carousel”>
<?php  $args = array( ‘post_type’ => ‘news_articles’, ‘posts_per_page’ => 100);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();  ?>
<?php $feat_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); ?>
<div class=”item darkCyan”>
<img src=”<?php echo $feat_image; ?>” alt=”<?php the_title(); ?>” />
<a href=”<?php the_permalink(); ?>”> <h4><?php the_title(); ?></h4>
<p><?php echo excerpt(12); ?>&gt;&gt;</p></a>
</div>
<?php endwhile;  ?>
<?php wp_reset_query(); ?>

</div>

</div>

</div>
</div>
</div>

</section>

<!————carousel End——————–>

<section class=”body_container”>
<div class=”wrapper”>
<div class=”left_sec”>
<h3>Social Feed</h3>
<span>Follow the latest in EV trends, misconceptions, tax incentives and facts with the hashtag #EVFacts </span>

<!—————————–isotope html———————————>

<div class=”container”>
<div id=”grid-gallery” class=”grid-gallery”>
<section class=”grid-wrap”>
<ul class=”grid”>
<!– for Masonry column width –>
<?php  $argsevent = array( ‘post_type’ => ‘e_event’, ‘posts_per_page’ => 100);
$eventloop = new WP_Query($argsevent );
while ( $eventloop->have_posts() ) : $eventloop->the_post();  ?>
<?php $event_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); ?>
<li>
<figure> <h3>  <a href=”<?php the_permalink(); ?>”><img src=”<?php bloginfo(‘template_url’) ; ?>/common/images/text_img.jpg” alt=”img01″></h3> <img src=”<?php echo $event_image ; ?>” alt=”img01″>
<figcaption>

<p><?php echo excerpt(12); ?></p>
</figcaption>
</a>
<div class=”social”>
<a class=”fb” href=”#”><img alt=”” src=”<?php bloginfo(‘template_url’) ; ?>/common/images/fb1.png”></a>
<div class=”right-social”>
<a href=”#”><img alt=”” src=”<?php bloginfo(‘template_url’) ; ?>/common/images/fb.png”></a>
<a href=”#”><img alt=”” src=”<?php bloginfo(‘template_url’) ; ?>/common/images/f-tweet.png”></a>

</div>
</div>
</figure>
</li>

<?php endwhile;  ?>

<?php wp_reset_query(); ?>

</ul>
</section>
</div>
</div>
</div>
<!—————————–isotope html End———————————>

<?php get_sidebar(); ?>

</div>
<section class=”gray_sec”>
<div class=”wrapper”>
<section class=”left_sec”>
<?php
$pageabout=get_page(ABOUT_US);
$about_image = wp_get_attachment_url( get_post_thumbnail_id($pageabout->ID) );
?>
<h3>About The Electric Generation</h3>
<img src=”<?php echo $about_image; ?>” alt=”image” />
<h4>Join the Electric Generation </h4>
<p><?php echo substr($pageabout->post_content,’0′,’500′); ?> <a  href=”<?php echo the_permalink(ABOUT_US); ?>”>Learn more about the Electric Generation >></a></p>
</section>
<section class=”right_sec”>
<h3>Driving Electric</h3>
<section class=”box”> <img src=”<?php bloginfo(‘template_url’) ?>/common/images/right_img3.jpg” alt=”image” />
<h4>Dipitata Pre Volupta Ssuntum</h4>
<p>Obiscia conse si doluptas nienimi nvenditio. Tur, eate versperspero ex et, quam, officto magnia cullacietur? Eserchil invel molupit, quamet vente omnia ipsam, comnim repe pel int, qui quam fuga. Dipitata pre volupta ssuntum. </p>
<p> Eserchil invel molupit, quamet vente omnia ipsam, comnim repe pel int, qui quam fuga. Dipitata pre volupta ssuntum. Expliquamus dit re recte eatibus dolecaborion eos nimus et volecto rionseque conesequam… <a href=”#”>>></a></p>
</section>
</section>
</div>
</section>

<?php get_footer(); ?>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s