Guest User

Untitled

a guest
Jan 16th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Homepage Template
  4. */
  5.  
  6. $home_content_title = cs_get_option('home_content_title');
  7. $home_content_text = cs_get_option('home_content_text');
  8. // $home_content_image = cs_get_option('home_content_image');
  9. $home_content_image_array = wp_get_attachment_image_src( cs_get_option('home_content_image'), 'large' );
  10.  
  11. if (!empty($home_content_image_array[0])) {
  12. $home_content_image = $home_content_image_array[0];
  13. } else {
  14. $home_content_image = ''.get_template_directory_uri().'/assets/img/homepageblock.jpg';
  15. }
  16.  
  17. get_header(); ?>
  18.  
  19.  
  20. <!-- ::::::::::::::::::::: start slider section:::::::::::::::::::::::::: -->
  21. <section class="slider-area">
  22.  
  23. <?php
  24. global $post;
  25. $args = array( 'posts_per_page' => 5, 'post_type'=> 'slide', 'orderby' => 'menu_order', 'order' => 'ASC' );
  26. $myposts = get_posts( $args );
  27. foreach( $myposts as $post ) : setup_postdata($post); ?>
  28.  
  29. <?php
  30. $btn_text = get_post_meta($post->ID, 'btn_text', true);
  31. $btn_link = get_post_meta($post->ID, 'btn_link', true);
  32. ?>
  33. <div class="homepage-slider" style="background-image: url(<?php the_post_thumbnail_url('large');?>);">
  34. <div class="display-table">
  35. <div class="display-table-cell">
  36. <div class="container">
  37. <div class="row">
  38. <div class="col-sm-7">
  39. <div class="slider-content">
  40. <h1><?php the_title(); ?></h1>
  41. <?php the_content(); ?>
  42. <a href="<?php echo $btn_link; ?>"><?php echo $btn_text; ?> <i class="fa fa-long-arrow-right"></i></a>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. <?php endforeach; wp_reset_query(); ?>
  51.  
  52. </section><!-- slider area end -->
  53.  
  54.  
  55. <?php get_template_part('content/promo'); ?>
  56.  
  57.  
  58. <!-- ::::::::::::::::::::: start block content area:::::::::::::::::::::::::: -->
  59. <section class="section-padding">
  60. <div class="container">
  61. <div class="row">
  62. <div class="col-md-6">
  63. <div class="block-text">
  64. <h2><?php echo $home_content_title; ?></h2>
  65. <?php echo wpautop( $home_content_text ); ?>
  66. </div>
  67. </div>
  68. <div class="col-md-6">
  69. <div class="block-img">
  70. <img src="<?php echo $home_content_image; ?>" alt="" />
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </section><!-- block area end -->
  76.  
  77.  
  78. <?php get_template_part( 'content/services' ); ?>
  79.  
  80.  
  81. <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment