Table of Contents

WordPress News Theme 5

<?php get_header(); ?>

<?php

$ntt_plugin_folder = get_bloginfo(‘wpurl’);

$ntt_plugin_folder .= ‘/wp-content/plugins/NTTFeaturedContent2/’;

$ntt_plugin_page = $ntt_plugin_folder . ‘js/featured_data1.txt’;

$ntt_plugin_style = $ntt_plugin_folder . ‘ntt_fc_style2.css’;

<LINK href=”<?php echo $ntt_plugin_style;?>” rel=”stylesheet” type=”text/css”>

<script type=”text/javascript” src=”<?php echo $ntt_plugin_folder; ?>js/featured_content.js”></script>

<div class=”ntt_featured_content”>

<?php

$ntt_stored_fc = file_get_contents($ntt_plugin_page);

echo $ntt_stored_fc;

</div>

<?php get_sidebar(‘first’); ?>

<div id=”mainContent”>

<div class=”featuredPosts”>

<ul class=”featuredLists”>

<!– To issue queries I need to hijack $wp_query. So, I can use it later

on the page I’m saving it to a temporary variable –>

$tempWPQuery = $wp_query;

$wp_query = null;

// Create a new WP_Query Object

$wp_query = new WP_Query();

// Issue a query that returns 4 posts

$wp_query->query(‘posts_per_page=5&category_name=Featured’);

// Cycle through all of the posts

while ($wp_query->have_posts()):

$wp_query->the_post();

<li>

<h3 class=”featuredTitle”><a href=”<?php the_permalink(); ?>”><?php $ntt_the_title = $post->post_title; echo substr($ntt_the_title, 0, 28); ?></a></h3>

<p class=”featuredExcerpt”><?php $ntt_the_excerpt = $post->post_excerpt; echo substr($ntt_the_excerpt, 0, 50); ?>

<a href=”<?php the_permalink(); ?>” class=”clickForMore”>More</a></p>

<img src=”<?php echo catch_that_image(); ?>” alt=”<?php the_title(); ?>” width=”60px” height=”60px” class=”featuredImage” />

</li>

// Reset wp_query to the default

$wp_query = $temp;

</ul>

</div> <!– End of featuredPosts div –>

<div class=”postLists”>

<!– To issue queries I need to hijack $wp_query. So, I can use it later

on the page I’m saving it to a temporary variable –>

$tempWPQuery = $wp_query;

$wp_query = null;

// Create a new WP_Query Object

$wp_query = new WP_Query();

// Issue a query that returns 4 posts

$wp_query->query(‘posts_per_page=4’);

// Cycle through all of the posts

while ($wp_query->have_posts()):

$wp_query->the_post();

<li>

<h3 class=”postTitle”><a href=”<?php the_permalink(); ?>”><?php $ntt_the_title = $post->post_title; echo substr($ntt_the_title, 0, 30); ?></a></h3>

<p class=”postExcerpt”><?php $ntt_the_excerpt = $post->post_excerpt; echo substr($ntt_the_excerpt, 0, 135); ?>

<a href=”<?php the_permalink(); ?>” class=”clickForMore”>More</a></p>

<img src=”<?php echo catch_that_image(); ?>” alt=”<?php the_title(); ?>” width=”85px” height=”85px” class=”postImage” />

</li>

// Reset wp_query to the default

$wp_query = null;

$wp_query = $temp;

</div>

<br /><br />

<div class=”morePosts”>

<!– To issue queries I need to hijack $wp_query. So, I can use it later

on the page I’m saving it to a temporary variable –>

$tempWPQuery = $wp_query;

$wp_query = null;

// Create a new WP_Query Object

$wp_query = new WP_Query();

// Issue a query that returns 4 posts

$wp_query->query(‘posts_per_page=8&offset=4’);

// Cycle through all of the posts

while ($wp_query->have_posts()):

$wp_query->the_post();

<div class=”recentPosts”>

<h3 class=”recentTitle”><a href=”<?php the_permalink(); ?>”><?php $ntt_the_title = $post->post_title; echo substr($ntt_the_title, 0, 20); ?></a></h3>

<img src=”<?php echo catch_that_image(); ?>” alt=”<?php the_title(); ?>” width=”150px” height=”150px” class=”recentImage” />

<p class=”recentExcerpt”><?php $ntt_the_excerpt = $post->post_excerpt; echo substr($ntt_the_excerpt, 0, 82); ?>

<a href=”<?php the_permalink(); ?>” class=”clickForMore”>More</a></p>

</div> <!– End of recentPosts div –>

// Reset wp_query to the default

$wp_query = null;

$wp_query = $temp;

</div> <!– End of morePosts div –>

</div> <!– End of mainContent div –>

<?php get_footer(); ?>

FOOTER.PHP

<div id=”footer”>

<div class=”footerContent”>

<?php wp_list_pages(‘depth=1&number=10&title_li=<div class=”sidebarTitle”><h4>Pages</h4></div>’ ); ?>

</div>

<div class=”footerContent”>

<div class=”footerTitle”><h4>Categories</h4></div>

<p class=”sidebarExcerpt”>

<?php wp_list_categories(‘depth=1&orderby=name&number=10&title_li=’ ); ?>

</div>

<div class=”footerFollow”>

<div class=”footerTitle”><h4>Follow Us</h4></div>

<a href=”<?php bloginfo(‘rss2_url’); ?>”><img src=”<?php bloginfo(‘template_directory’); ?>/images/rss_logo.png” height=”50px” width=”50px”</a>

<a href=”http://www.twitter.com/newthinktank”><img src=”<?php bloginfo(‘template_directory’); ?>/images/twitter_logo.png” height=”50px” width=”50px”</a>

<a href=”http://www.facebook.com/newthinktank”><img src=”<?php bloginfo(‘template_directory’); ?>/images/facebook_logo.png” height=”50px” width=”50px”</a>

<a href=”http://www.linkedin.com/in/derekbanas”><img src=”<?php bloginfo(‘template_directory’); ?>/images/linkedin_logo.png” height=”50px” width=”50px”</a></a>

</div>

<br /><br /><br />

<div class=”copyright”>

&copy;<?php echo date(“Y”); echo ” “; bloginfo(‘name’); ?>

<?php echo ‘ Designed by <a href=”http://newthinktank.com” alt=”New Think Tank”>New Think Tank</a>’; ?>

</div>

<?php wp_footer(); ?>

<!– Don’t forget analytics –>

This content was originally published here.