Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Template Name: Homepage
- **/
- // calling the header.php
- get_header();
- // action hook for placing content above #container
- thematic_abovecontainer();
- ?>
- <div id="container">
- <?php
- // action hook for inserting content above #content
- thematic_abovecontent();
- // filter for manipulating the element that wraps the content
- echo apply_filters( 'thematic_open_id_content', '<div id="content">' . "\n\n" );
- // calling the widget area 'page-top'
- get_sidebar('page-top');
- // start the loop
- // WPMl Support
- //while ( have_posts() ) : the_post();
- the_post();
- //\ WPML Support
- // action hook for inserting content above #post
- thematic_abovepost();
- ?>
- <?php
- echo '<div id="post-' . get_the_ID() . '" ';
- // Checking for defined constant to enable Thematic's post classes
- if ( ! ( THEMATIC_COMPATIBLE_POST_CLASS ) ) {
- post_class();
- echo '>';
- } else {
- echo 'class="';
- thematic_post_class();
- echo '">';
- }
- // creating the post header
- //thematic_postheader();
- ?>
- <div class="entry-content">
- <div class="home-left">
- <?php
- // The Content
- echo '<div id="home-content">';
- the_content();
- echo '</div><!– /#home-content –>';
- //wp_link_pages( "\t\t\t\t\t<div class='page-link'>" . __( 'Pages: ', 'thematic' ), "</div>\n", 'number' );
- //edit_post_link( __( 'Edit', 'thematic' ), '<span class="edit-link">','</span>' );
- ?>
- <?php
- // Homepage Infobox
- /*
- $homepage_infobox_image = get_post_meta( $post->ID, '_transcrip_home_infobox_image', true);
- $homepage_infobox_link = get_post_meta( $post->ID, '_transcrip_home_infobox_link', true);
- if ( $homepage_infobox_image != '' ) {
- echo '<div id="home-infobox">';
- if ( $homepage_infobox_link != '' )
- echo '<a href="' . esc_url($homepage_infobox_link) . '">';
- echo '<img id="homepage-infobox" src="' . esc_url($homepage_infobox_image) . '" />';
- if ( $homepage_infobox_link != '' )
- echo '</a>';
- echo '</div><!– /#home-infobox –>';
- }
- */
- $facts_args = array(
- 'post_type' => 'facts',
- 'posts_per_page' => '-1', // show all
- 'order' => 'ASC',
- 'orderby' => 'rand'
- );
- $facts_loop = new WP_Query($facts_args);
- if ( $facts_loop->have_posts() ) :
- $count = 0;
- // start big facts
- echo '<div id="big-facts">';
- while ( $facts_loop->have_posts() ) : $facts_loop->the_post();
- $count++;
- $facts_title = get_post_meta( $post->ID, '_transcrip_big_facts_title', true);
- $facts_image = get_post_meta( $post->ID, '_transcrip_big_facts_image', true);
- $facts_link = get_post_meta( $post->ID, '_transcrip_big_facts_link', true);
- // if there's no image bail immediately
- if ( $facts_image != '' ) {
- if ( $facts_link != '' )
- echo '<a href="' . esc_url($facts_link) . '" title="' . esc_attr($facts_title) . '">';
- echo '<img id="big-facts-'. $count .'" src="' . esc_url($facts_image) . '" alt="' . esc_attr($facts_title) . '" />';
- if ( $facts_link != '' )
- echo '<span class="arrow"></span>';
- if ( $facts_link != '' )
- echo '</a>';
- } // end facts_image check
- endwhile;
- // end big facts
- echo '</div><!– /#big-facts –>';
- endif;
- wp_reset_query();
- ?>
- </div><!– /.home-left –>
- <div class="home-right">
- <?php
- // Box 1
- $homepage_box_1_title = get_post_meta( $post->ID, '_transcrip_home_box_1_title', true);
- $homepage_box_1_content = get_post_meta( $post->ID, '_transcrip_home_box_1_content', true);
- $homepage_box_1_image = get_post_meta( $post->ID, '_transcrip_home_box_1_image', true);
- $homepage_box_1_colour = get_post_meta( $post->ID, '_transcrip_home_box_1_colour', true);
- $homepage_box_1_link = get_post_meta( $post->ID, '_transcrip_home_box_1_link', true);
- if ( ( $homepage_box_1_title != '' ) || ( $homepage_box_1_content != '' ) || ( $homepage_box_1_image != '' ) ) {
- echo '<div id="homepage-box-1">';
- if ( $homepage_box_1_link != '' )
- echo '<a href="' . esc_url($homepage_box_1_link) . '">';
- if ( $homepage_box_1_image != '' )
- echo '<img src="' . esc_attr( $homepage_box_1_image) . '" />';
- if ( $homepage_box_1_colour != '' )
- echo '<div id="homepage-box-1-content" style="background: ' . esc_attr( $homepage_box_1_colour) . '">';
- else
- echo '<div id="homepage-box-1-content">';
- if ( $homepage_box_1_title != '' )
- echo '<h3>' . esc_attr( $homepage_box_1_title) . '</h3>';
- if ( $homepage_box_1_content != '' )
- echo wpautop( $homepage_box_1_content);
- echo '</div><!– /#homepage-box-1-content –>';
- if ( $homepage_box_1_link != '' )
- echo '<span class="arrow"></span>';
- if ( $homepage_box_1_link != '' )
- echo '</a>';
- echo '</div><!– /#homepage-box-1 –>';
- }
- ?>
- <?php
- // Box 2
- $homepage_box_2_title = get_post_meta( $post->ID, '_transcrip_home_box_2_title', true);
- $homepage_box_2_content = get_post_meta( $post->ID, '_transcrip_home_box_2_content', true);
- $homepage_box_2_image = get_post_meta( $post->ID, '_transcrip_home_box_2_image', true);
- $homepage_box_2_colour = get_post_meta( $post->ID, '_transcrip_home_box_2_colour', true);
- $homepage_box_2_link = get_post_meta( $post->ID, '_transcrip_home_box_2_link', true);
- if ( ( $homepage_box_2_title != '' ) || ( $homepage_box_2_content != '' ) || ( $homepage_box_2_image != '' ) ) {
- if ( $homepage_box_2_colour != '' )
- echo '<div id="homepage-box-2" style="background: ' . esc_attr( $homepage_box_2_colour) . '">';
- else
- echo '<div id="homepage-box-2">';
- if ( $homepage_box_2_link != '' )
- echo '<a href="' . esc_url($homepage_box_2_link) . '">';
- if ( $homepage_box_2_image != '' )
- echo '<img src="' . esc_attr( $homepage_box_2_image) . '" />';
- if ( $homepage_box_2_title != '' )
- echo '<h3>' . esc_attr( $homepage_box_2_title) . '</h3>';
- if ( $homepage_box_2_content != '' )
- echo wpautop( $homepage_box_2_content);
- if ( $homepage_box_2_link != '' )
- echo '</a>';
- echo '</div><!– /#homepage-box-2–>';
- }
- ?>
- <?php
- // Box 3
- $homepage_box_3_title = get_post_meta( $post->ID, '_transcrip_home_box_3_title', true);
- $homepage_box_3_content = get_post_meta( $post->ID, '_transcrip_home_box_3_content', true);
- $homepage_box_3_image = get_post_meta( $post->ID, '_transcrip_home_box_3_image', true);
- $homepage_box_3_colour = get_post_meta( $post->ID, '_transcrip_home_box_3_colour', true);
- $homepage_box_3_link = get_post_meta( $post->ID, '_transcrip_home_box_3_link', true);
- if ( ( $homepage_box_3_title != '' ) || ( $homepage_box_3_content != '' ) || ( $homepage_box_3_image != '' ) ) {
- if ( $homepage_box_3_colour != '' )
- echo '<div id="homepage-box-3" style="background: ' . esc_attr( $homepage_box_3_colour) . '">';
- else
- echo '<div id="homepage-box-3">';
- if ( $homepage_box_3_link != '' )
- echo '<a href="' . esc_url($homepage_box_3_link) . '">';
- if ( $homepage_box_3_image != '' )
- echo '<img src="' . esc_attr( $homepage_box_3_image) . '" />';
- if ( $homepage_box_3_title != '' )
- echo '<h3>' . esc_attr( $homepage_box_3_title) . '</h3>';
- if ( $homepage_box_3_content != '' )
- echo wpautop( $homepage_box_3_content);
- if ( $homepage_box_3_link != '' )
- echo '</a>';
- echo '</div><!– /#homepage-box-3–>';
- }
- ?>
- <?php get_template_part('includes/clearfix'); ?>
- </div><!– /.home-right –>
- <?php get_template_part('includes/clearfix'); ?>
- </div>
- </div><!– .post –>
- <?php
- // calls the do_action for inserting content below #post
- thematic_belowpost();
- // action hook for calling the comments_template
- thematic_comments_template();
- // end loop
- // WPMl Support
- //endwhile;
- //\WPML Support
- // calling the widget area 'page-bottom'
- get_sidebar( 'page-bottom' );
- ?>
- </div><!– #content –>
- <?php
- // action hook for inserting content below #content
- thematic_belowcontent();
- ?>
- </div><!– #container –>
- <?php
- // action hook for placing content below #container
- thematic_belowcontainer();
- // calling footer.php
- get_footer();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement