Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Template Name: Family services Page
- * The template for displaying pages
- *
- * This is the template that displays all pages by default.
- * Please note that this is the WordPress construct of pages and that
- * other "pages" on your WordPress site will use a different template.
- *
- * @package WordPress
- * @subpackage sinda
- */
- get_header();
- ?>
- <body>
- <?php include(get_template_directory() . "/menu.php"); ?>
- <!-- Banner
- ================================================== -->
- <div class="slider_page_container">
- <!-- Get from post type: banner -->
- <?php
- $args = array('post_type' => 'banner', 'tax_query' => array(
- array(
- 'taxonomy' => 'banner_type', //or tag or custom taxonomy
- 'field' => 'slug',
- 'terms' => array('parenting')
- )
- ));
- $loop = new WP_Query($args);
- while ($loop->have_posts()) : $loop->the_post();
- //$feat_image = wp_get_attachment_url(get_post_thumbnail_id($post->ID));
- $feat_image = wp_get_attachment_image_src($post->banner_photo, 'full');
- $feat_image_mt = wp_get_attachment_image_src($post->banner_mobile_n_tablet, 'full');
- $useragent = $_SERVER['HTTP_USER_AGENT'];
- if($post->banner_link != ''){
- echo '<a href="' . $post->banner_link . '">';
- }
- if (strpos($useragent, 'iPad') !== false || strpos($useragent, 'Mobile') !== false) {
- if ($feat_image_mt[0] != "") {
- echo '<img src="' . $feat_image_mt[0] . '"/>';
- } else {
- echo '<img src="' . $feat_image[0] . '"/>';
- }
- } else {
- echo '<img src="' . $feat_image[0] . '"/>';
- }
- if($post->banner_link != ''){
- echo '</a>';
- }
- endwhile;
- ?>
- </div>
- <!-- /.Banner -->
- <div class="clearfix"></div>
- <!-- START EDUCATIONS -->
- <div class="container listing_page_wrapper" data-aos="fade-up">
- <img src="<?php echo get_template_directory_uri(); ?>/imgs/icon-parenting-black.png"/>
- <?php
- $post = get_post("24");
- $content = apply_filters('the_content', $post->post_content);
- echo '<h1>'.strtoupper($post->post_title) .'</h1>';
- echo '<hr class="h1_underline">';
- echo $content;
- ?>
- </div>
- <!-- /END EDUCATIONS -->
- <!-- START OUR STORY-->
- <?php
- //list terms in a given taxonomy
- $taxonomy = 'family_type';
- $tax_terms = get_terms($taxonomy, array('orderby' => 'id'));
- if (count($tax_terms) > 0) {
- ?>
- <div class="container-fluid card-alt-bg" data-aos="fade-up">
- <div class="container educations_landing_wrapper">
- <div class="current_education_pager" data-expand="false" data-currentindex="0">
- <?php
- foreach ($tax_terms as $tax_term) {
- echo strtoupper($tax_term->name);
- break;
- }
- ?>
- </div>
- <div id="bx-pager-educations">
- <?php
- $iCount = 0;
- foreach ($tax_terms as $tax_term) {
- echo '<a data-slide-index="' . $iCount . '" href="javascript:void(0);" data-menutext="' . strtoupper($tax_term->name) . '">' . strtoupper($tax_term->name) . '</a>';
- $iCount++;
- }
- ?>
- </div>
- <ul class="bxslider_educations">
- <?php
- //list terms in a given taxonomy
- $tax_terms = get_terms($taxonomy, array('orderby' => 'id'));
- foreach ($tax_terms as $tax_term) {
- echo '<li>';
- echo '<div class="container container_bxslider_educations">';
- //$args = array('post_type' => 'family','posts_per_page'=>-1);
- $args = array('post_type' => 'family', 'posts_per_page' => -1, 'orderby'=>'menu_order title','order'=> 'ASC','tax_query' => array(
- array(
- 'taxonomy' => $taxonomy, //or tag or custom taxonomy
- 'field' => 'slug',
- 'terms' => array($tax_term->slug)
- )
- ));
- $loop = new WP_Query($args);
- while ($loop->have_posts()) : $loop->the_post();
- //$feat_image = wp_get_attachment_url(get_post_thumbnail_id($post->ID));
- $photoArr = wp_get_attachment_image_src($post->thumbnail_image, 'full');
- $hoverdetail = get_post_meta($post->ID, 'hover_detail', true);
- $registration_status = get_post_meta($post->ID, 'registration_status', true);
- $closing_date = get_post_meta($post->ID, 'closing_date', true);
- if ($registration_status == "close" || ($closing_date != '' && time() > strtotime($closing_date)) ) {
- echo '<div class="education_entry reg_close" style="background-image:url(\'' . $photoArr[0] . '\')">';
- } else {
- echo '<div class="education_entry" style="background-image:url(\'' . $photoArr[0] . '\')">';
- }
- echo '<a href="' . get_permalink($post->ID) . '">';
- echo '<img src="' . $photoArr[0] . '"/>';
- echo '<span class="intro pinkred">' . $post->post_title . '</span>';
- if ($registration_status == "close" || ($closing_date != '' && time() > strtotime($closing_date)) ) {
- echo '<span class="detailclose">REGISTRATION CLOSED</span>';
- } else {
- echo '<span class="detail pinkred"><div class="hover-detail-inner">' . $hoverdetail . '</div></span>';
- }
- echo '</a>';
- echo '</div>';
- endwhile;
- echo "</div>";
- echo "</li>";
- }
- ?>
- </ul>
- </div>
- </div>
- <!-- /END OUR STORY -->
- <?php } ?>
- <?php get_footer(); ?>
- <script type="text/javascript">
- $(document).ready(function () {
- if (/Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
- slider = $('.bxslider_educations').bxSlider();
- slider.destroySlider();
- var startSlide = 0;
- var tab = getUrlParameter("tab");
- if (tab == 60){
- //Children
- startSlide =0;
- }else if (tab==61){
- //Parenting
- startSlide =1;
- }else{
- startSlide = 0;
- }
- if (startSlide > 0) {
- var selected_data = $("#bx-pager-educations").find("[data-slide-index=" + startSlide + "]");
- var selected_slide_index =selected_data.data('slide-index');
- var selected_menutext = selected_data.data('menutext');
- $('.bxslider_educations li').each(function (i, obj) {
- if (i != selected_slide_index) {
- $(this).hide();
- }
- else {
- $(this).show();
- $(".current_education_pager").text(selected_menutext);
- }
- });
- }
- } else {
- var tab = getUrlParameter("tab");
- var startSlide=0;
- if (tab == 60){
- //Children
- startSlide =0;
- }else if (tab==61){
- //Parenting
- startSlide =1;
- }else{
- startSlide = 0;
- }
- $('.bxslider_educations').bxSlider({
- pagerCustom: '#bx-pager-educations',
- controls: false,
- startSlide: startSlide
- });
- $("#bx-pager-educations_remove a").click(function () {
- var animationName = "rubberBand";
- var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
- $(".education_entry").addClass('animated bounceIn').one(animationEnd, function () {
- $(".education_entry").removeClass('animated bounceIn');
- //console.log("in");
- });
- //console.log("end");
- });
- }
- });
- var getUrlParameter = function getUrlParameter(sParam) {
- var sPageURL = decodeURIComponent(window.location.search.substring(1)),
- sURLVariables = sPageURL.split('&'),
- sParameterName,
- i;
- for (i = 0; i < sURLVariables.length; i++) {
- sParameterName = sURLVariables[i].split('=');
- if (sParameterName[0] === sParam) {
- return sParameterName[1] === undefined ? true : sParameterName[1];
- }
- }
- };
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment