Advertisement
towfiqi

landing-page.php

Apr 25th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.05 KB | None | 0 0
  1. <?php get_header();
  2. /**
  3. * Template Name: Front-Page Template
  4. *
  5. * This is the template that displays all pages by default.
  6. * Please note that this is the WordPress construct of pages
  7. * and that other 'pages' on your WordPress site may use a
  8. * different template.
  9. *
  10. * @link https://codex.wordpress.org/Template_Hierarchy
  11. *
  12. * @package Tar
  13. */
  14. ?>
  15.  
  16.  
  17. <?php if( get_theme_mod( 'cta_background_image_setting' != "" , get_template_directory_uri(). '/assets/images/banner.jpg')): ?>
  18.  
  19. <!-- start welcome text -->
  20. <section class="welcome-text" >
  21. <h2><?php echo do_shortcode(get_theme_mod('cta_welcome_text' , esc_html__( 'Advance. Strong. Reliable', 'tar') ) ); ?></h2>
  22. <p><?php echo do_shortcode( get_theme_mod('cta_welcome_text_p' , esc_html__('A clean bloat free WordPress theme for your site', 'tar') ) ); ?></p>
  23. <a class="xxx" href="<?php echo do_shortcode(esc_url(get_theme_mod('cta_button_href', '##'))); ?>"> <button><?php echo do_shortcode(esc_html(get_theme_mod( 'cta_button' , __('', 'tar')))); ?></button></a>
  24. </section>
  25. <!-- end welcome text -->
  26.  
  27.  
  28. <?php endif; ?>
  29.  
  30. <!-- start feature-list -->
  31. <section class="features-list">
  32. <h4><?php echo do_shortcode(get_theme_mod( 'features_head_text_settings' , __('Use this block to show three key features', 'tar'))); ?></h4>
  33.  
  34. <div class="features-block-wrap">
  35. <!--FEATURE BLOCK 1-->
  36. <?php
  37. $block1_tt = get_theme_mod( 'features_one_settings' , esc_html__('Dolore Libero', 'tar'));
  38. $block1_para = get_theme_mod( 'features_one_para_settings' , esc_html__('Aenean vel justo nulla, at gravida elit. In hac habitasse platea dictumst. Quisque gravida commodo volutpat. Vivamus blandit risus in urna venenatis accumsan.', 'tar'));
  39. $block1_icon = get_theme_mod('features_one_icon' ,'fa-car' );
  40.  
  41. if( !empty($block1_tt) || !empty($block1_tt) ) { ?>
  42. <div class="features-block-one features-block">
  43. <div class="icon-one">
  44. <span class="fa <?php echo $block1_icon; ?>"></span>
  45. </div>
  46.  
  47. <h3><?php echo do_shortcode($block1_tt); ?></h3>
  48. <p><?php echo do_shortcode($block1_para); ?></p>
  49. </div>
  50. <?php } ?>
  51. <!--FEATURE BLOCK 1 END-->
  52.  
  53. <!--FEATURE BLOCK 2-->
  54. <?php
  55. $block2_tt = get_theme_mod( 'features_two_settings' , esc_html__('Dolore Libero', 'tar'));
  56. $block2_para = get_theme_mod( 'features_two_para_settings' , esc_html__('Aenean vel justo nulla, at gravida elit. In hac habitasse platea dictumst. Quisque gravida commodo volutpat. Vivamus blandit risus in urna venenatis accumsan.', 'tar'));
  57. $block2_icon = get_theme_mod('features_two_icon' ,'fa-bolt' );
  58.  
  59. if( !empty($block2_tt) || !empty($block2_tt) ) { ?>
  60. <div class="features-block-one features-block">
  61. <div class="icon-one">
  62. <span class="fa <?php echo $block2_icon; ?>"></span>
  63. </div>
  64.  
  65. <h3><?php echo do_shortcode($block2_tt); ?></h3>
  66. <p><?php echo do_shortcode($block2_para); ?></p>
  67. </div>
  68. <?php } ?>
  69. <!--FEATURE BLOCK 2 END-->
  70.  
  71. <!--FEATURE BLOCK 2-->
  72. <?php
  73. $block3_tt = get_theme_mod( 'features_three_settings' , esc_html__('Dolore Libero', 'tar'));
  74. $block3_para = get_theme_mod( 'features_three_para_settings' , esc_html__('Aenean vel justo nulla, at gravida elit. In hac habitasse platea dictumst. Quisque gravida commodo volutpat. Vivamus blandit risus in urna venenatis accumsan.', 'tar'));
  75. $block3_icon = get_theme_mod('features_three_icon' ,'fa-glass' );
  76.  
  77. if( !empty($block3_tt) || !empty($block3_tt) ) { ?>
  78. <div class="features-block-one features-block">
  79. <div class="icon-one">
  80. <span class="fa <?php echo $block3_icon; ?>"></span>
  81. </div>
  82.  
  83. <h3><?php echo do_shortcode($block3_tt); ?></h3>
  84. <p><?php echo do_shortcode($block3_para); ?></p>
  85. </div>
  86. <?php } ?>
  87. <!--FEATURE BLOCK 2 END-->
  88. </div>
  89.  
  90.  
  91. <div class="clearfix"></div>
  92. </section>
  93. <!-- end feature-list -->
  94.  
  95.  
  96. <!-- start portfolio -->
  97. <section class="portfolio">
  98. <p><?php echo do_shortcode(get_theme_mod( 'porfolio_head_text', esc_html__('See our Portfolio', 'tar'))); ?></p>
  99. <?php $cat_id = intval( get_theme_mod( 'cats_elect', 1 ) ); ?>
  100.  
  101. <?php $tarPosts = new WP_Query('cat='.$cat_id.'&posts_per_page=6&orderby=title&order=ASC'); ?>
  102. <?php ?>
  103. <?php while($tarPosts->have_posts()) : $tarPosts->the_post(); ?>
  104. <div class="portfolio-image">
  105. <?php the_post_thumbnail(); ?>
  106. <a href="<?php the_permalink(); ?>" class="image-section"> <?php the_title(); ?></a>
  107.  
  108. </div>
  109. <?php endwhile; ?>
  110.  
  111. <?php wp_reset_postdata(); ?>
  112.  
  113. <div class="clearfix"></div>
  114. </section>
  115. <!-- end portfolio -->
  116.  
  117.  
  118.  
  119. <!-- start bottom call to action -->
  120. <section class="bottom-call">
  121.  
  122. <div class="call-section-one">
  123. <p><?php echo do_shortcode(get_theme_mod( 'second_cta_head_text', esc_html__('Ultrices ante sagittis nunc senectus libero netus', 'tar'))); ?></p>
  124.  
  125. </div>
  126. <!-- <div class="clearfix"></div> -->
  127. <div class="call-section-two">
  128. <a href="<?php echo do_shortcode(esc_url(get_theme_mod('second_cta_button_href', '##'))); ?>"><button><?php echo do_shortcode(get_theme_mod( 'second_cta_button_text', esc_html__('See more', 'tar'))); ?></button></a>
  129. </div>
  130.  
  131. </section>
  132. <!-- end bottom call to action -->
  133.  
  134.  
  135.  
  136.  
  137.  
  138. <!-- start blog post -->
  139. <section class="frontpage-post-blog">
  140. <h4><?php echo do_shortcode(get_theme_mod( 'blog_head_text', esc_html__('Check out blog', 'tar'))); ?></h4>
  141.  
  142. <?php $cat_id = intval( get_theme_mod( 'blog_cats', 1 ) ); ?>
  143.  
  144. <div class="frontpage-post-wrapper">
  145. <?php
  146. if ( get_query_var('paged') ) {
  147. $paged = get_query_var('paged');
  148. } elseif ( get_query_var('page') ) {
  149. $paged = get_query_var('page');
  150. } else {
  151. $paged = 1;
  152. }
  153. $args = array(
  154. 'cat' => $cat_id,
  155. 'ignore_sticky_posts' => 1,
  156. 'post_type' => 'post',
  157. 'paged' => $paged,
  158. );
  159. $wp_query = new WP_Query( $args ); ?>
  160. <?php get_template_part( 'template-parts/loops' ); ?>
  161. <div class="front-page-pagination">
  162. <?php echo tar_home_pagination( $wp_query ); ?>
  163. </div>
  164. <?php wp_reset_postdata(); ?>
  165. </div>
  166.  
  167. </section>
  168. <!-- end blog post -->
  169.  
  170.  
  171.  
  172. <!-- start signup section -->
  173. <section class="frontpage-signup" >
  174. <p><?php echo do_shortcode(get_theme_mod( 'email_subscribe_header', esc_html__('Aenean vel justo nulla, at gravida elit. In hac habitasse platea dictumst. Quisque gravida commodo volutpat. Vivamus blandit risus in urna venenatis accumsan ', 'tar'))); ?></p>
  175. </section>
  176. <!-- end signup section -->
  177.  
  178. </main><!-- #main -->
  179. </div><!-- #primary -->
  180. <section class="footer-widget">
  181. <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('footer') ) : endif; ?>
  182. <div class="clearfix"></div>
  183. </section>
  184. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement