<?php $args = array('sort_order' => 'ASC', 'sort_column' => 'post_title', 'hierarchical' => 1, 'child_of' => 0, 'offset' => 0, 'post_type' => 'based_slider', 'post_status' => 'publish'); $data = get_pages($args); $recent_posts = wp_get_recent_posts($args); foreach ($recent_posts as $recent) { $feat_image = wp_get_attachment_url(get_post_thumbnail_id($recent["ID"])); if (empty($feat_image)) { $feat_image = get_post_content_img($recent["post_content"]); } if ($postid != 6) { if (!empty($feat_image)) { $postid++; $excerpt = $recent["post_excerpt"]; if (empty($excerpt)) { $excerpt = wp_strip_all_tags($recent["post_content"]); } echo ' <div class="slider-show" style=" width: 95% ; background-size: 100% 100%; height: 280px;background-image:url(' . $feat_image . ');"><div class="slider-data slider-data' . $postid . '" data-img="' . $feat_image . '" > <p class="post-title">' . $recent["post_title"] . '</p> <p class="post-description">' . $excerpt . '</p> </div></div>'; } } }
$datac = 1; } $all_wp_pages_sub = get_parent_page_data($wp_pages->ID); $tcount_sub = 0; foreach ($all_wp_pages_sub as $wp_pages_sub) { if ($tcount_sub != 3) { $tcount_sub++; $dataparent = $wp_pages->ID; if ($dataparent != 0) { $feat_image = wp_get_attachment_url(get_post_thumbnail_id($wp_pages_sub->ID)); $dataclass_sub = "display:none;"; if ($dataactive == $dataparent) { $dataclass_sub = "display:block;"; } if (empty($feat_image)) { $feat_image = get_post_content_img($wp_pages_sub->post_content); } if ($feat_image == "") { $feat_image = get_template_directory_uri() . "/images/no-image.png"; } $excerpt = $wp_pages_sub->post_excerpt; if (empty($excerpt)) { $excerpt = wp_strip_all_tags(get_post_limit_content($wp_pages_sub->post_content)); } $sub_child_data .= '<div class="col-md-4 allchild childpage' . $dataparent . '" style="padding: 15px;' . $dataclass_sub . ' padding-right: 0px;"><img class="child-images" src="' . $feat_image . '" /><p ><a href="' . get_permalink($wp_pages_sub->ID) . '" class="child-page-tile">' . $wp_pages_sub->post_title . '</a></p><p class="child-page-content">' . $excerpt . '</p></div>'; } } } if ($tcount != 5) { $tcount++; echo '<li class="pages-title child-post ' . $dataclass . '" data-id="' . $wp_pages->ID . '" data-pid="' . $dataclass . '">