golden hour
/home/phakp/public_html/wp-content/themes/ngo-social-services/page-template
⬆️ Go Up
Upload
File/Folder
Size
Actions
custom-front-page.php
5.76 KB
Del
OK
Edit: custom-front-page.php
<?php /** * Template Name: Custom Front Page */ get_header(); ?> <main id="skip-content"> <section id="top-slider"> <?php $charity_zone_slide_pages = array(); for ( $count = 1; $count <= 3; $count++ ) { $mod = intval( get_theme_mod( 'charity_zone_top_slider_page' . $count )); if ( 'page-none-selected' != $mod ) { $charity_zone_slide_pages[] = $mod; } } if( !empty($charity_zone_slide_pages) ) : $args = array( 'post_type' => 'page', 'post__in' => $charity_zone_slide_pages, 'orderby' => 'post__in' ); $query = new WP_Query( $args ); if ( $query->have_posts() ) : $i = 1; ?> <div class="owl-carousel" role="listbox"> <?php while ( $query->have_posts() ) : $query->the_post(); ?> <div class="slider-box"> <img src="<?php esc_url(the_post_thumbnail_url('full')); ?>"/> <div class="slider-inner-box"> <a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a> <p><?php the_excerpt(); ?></p> <div class="donate-btn text-center"> <a href="<?php the_permalink(); ?>"><?php esc_html_e('Donate Now','ngo-social-services'); ?></a> </div> </div> </div> <?php $i++; endwhile; wp_reset_postdata();?> </div> <?php else : ?> <div class="no-postfound"></div> <?php endif; endif;?> </section> <section id="serve-sec"> <div class="container"> <div class="row"> <?php $charity_zone_catData = get_theme_mod('charity_zone_services',''); if($charity_zone_catData){ $charity_zone_page_query = new WP_Query(array( 'category_name' => esc_html($charity_zone_catData,'ngo-social-services'))); while( $charity_zone_page_query->have_posts() ) : $charity_zone_page_query->the_post(); ?> <div class="col-lg-4 col-md-4"> <div class="serv-box"> <?php the_post_thumbnail(); ?> <h4><a href="<?php the_permalink(); ?>" alt="<?php the_title(); ?>"><?php the_title(); ?></a></h4> <p><?php $charity_zone_excerpt = get_the_excerpt(); echo esc_html( charity_zone_string_limit_words( $charity_zone_excerpt,8 ) ); ?></p> </div> </div> <?php endwhile; wp_reset_postdata(); } ?> </div> </div> </section> <section id="about_sec"> <div class="container"> <?php $charity_zone_about_pages = array(); $mod = intval( get_theme_mod( 'charity_zone_about_page' )); if ( 'page-none-selected' != $mod ) { $charity_zone_about_pages[] = $mod; } if( !empty($charity_zone_about_pages) ) : $args = array( 'post_type' => 'page', 'post__in' => $charity_zone_about_pages, 'orderby' => 'post__in' ); $query = new WP_Query( $args ); if ( $query->have_posts() ) : ?> <?php while ( $query->have_posts() ) : $query->the_post(); ?> <div class="row"> <div class="col-lg-6 col-md-6"> <div class="about-inner-box"> <h3><?php the_title(); ?></h3> <p><?php the_excerpt(); ?></p> <div class="donate-btn"> <a href="<?php the_permalink(); ?>"><?php esc_html_e('Donate Now','ngo-social-services'); ?></a> </div> </div> </div> <div class="col-lg-6 col-md-6"> <img src="<?php esc_url(the_post_thumbnail_url('full')); ?>"/> </div> </div> <?php $i++; endwhile; wp_reset_postdata();?> <?php else : ?> <div class="no-postfound"></div> <?php endif; endif;?> </div> </section> <section id="causes-sec" class="pb-5"> <div class="container"> <div class="row mb-4"> <div class="col-lg-4 col-md-4 col-sm-4 self-align"> <?php if(get_theme_mod('ngo_social_services_causes_title') != ''){ ?> <h3 class="mb-0"><?php echo esc_html(get_theme_mod('ngo_social_services_causes_title','')); ?></h3> <?php }?> </div> <div class="col-lg-8 col-md-8 col-sm-8 self-align"> <?php if(get_theme_mod('ngo_social_services_causes_text') != ''){ ?> <p class="mb-0"><?php echo esc_html(get_theme_mod('ngo_social_services_causes_text','')); ?></p> <?php }?> </div> </div> <div class="row"> <?php $ngo_social_services_catData = get_theme_mod('ngo_social_services_causes',''); if($ngo_social_services_catData){ $ngo_social_services_page_query = new WP_Query(array( 'category_name' => esc_html($ngo_social_services_catData,'ngo-social-services'))); while( $ngo_social_services_page_query->have_posts() ) : $ngo_social_services_page_query->the_post(); ?> <div class="col-lg-3 col-md-3"> <div class="causes-box mb-4"> <?php the_post_thumbnail(); ?> <div class="causes-inner-box"> <h5><?php the_category(); ?></h5> <h4><a href="<?php the_permalink(); ?>" alt="<?php the_title(); ?>"><?php the_title(); ?></a></h4> <p class="mb-0"><?php $ngo_social_services_excerpt = get_the_excerpt(); echo esc_html( charity_zone_string_limit_words( $ngo_social_services_excerpt,8 ) ); ?></p> </div> </div> </div> <?php endwhile; wp_reset_postdata(); } ?> </div> </div> </section> </main> <?php get_footer(); ?>
Save