0 ){
?>
0 ) {
$page_ids[] = absint( $page_id );
}
}
if ( empty( $page_ids ) ) {
return $output;
}
$args = array(
'posts_per_page' => count( $page_ids ),
'orderby' => 'post__in',
'post_type' => 'page',
'post__in' => $page_ids,
'post_status' => 'publish',
'meta_query' => array(
array( 'key' => '_thumbnail_id' ),
),
);
$posts = get_posts( $args );
$c = 0;
foreach ( $posts as $post ) {
if ( has_post_thumbnail( $post->ID ) ) {
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
$output[$c]['image'] = sprintf('',
esc_url( $image[0] ),
esc_html( $post->post_title),
esc_html( $post->post_title)
);
$output[$c]['title'] = sprintf('%1$s
', $post->post_title);
$output[$c]['excerpt'] = hotelgalaxy_trim_words($post->ID, $post->post_content );
$c++;
}
}
return $output;
}
}
if(!function_exists('hotelgalaxy_trim_words')){
function hotelgalaxy_trim_words( $id, $content, $URL=null, $is_readmore = true ){
$slider_btn = hotelgalaxy_get_option('slider_button_text');
$excerpt_word = hotelgalaxy_get_option('slider_excerpt_word');
$target = hotelgalaxy_get_option('slider_button_target') ? '_blank' : '_self';
$args= '';
if( !empty( $slider_btn ) && absint( $is_readmore ) == true){
$args = apply_filters('hotelgalaxy_slider_more_button', sprintf(
'',
esc_url( (empty($URL)) ? get_permalink( $id ) : $URL ),
esc_attr( $target ),
esc_html( $slider_btn )
) );
}
$html_trim = wp_trim_words( strip_shortcodes( wp_strip_all_tags( $content ) ), $excerpt_word );
$html_out = sprintf('%1$s
%2$s',$html_trim, $args);
return $html_out;
}
}
if( !function_exists('hotelgalaxy_slider_indicators') ){
function hotelgalaxy_slider_indicators(){
$page_ids = array();
for ( $i = 1; $i <= 5 ; $i++ ) {
$page_id = get_theme_mod( "Page_slider_$i" );
if ( absint( $page_id ) > 0 ) {
$page_ids[] = absint( $page_id );
}
}
if( count( $page_ids ) > 1 ){
echo '';
foreach ($page_ids as $index => $pageId) {
$active = ( $index==0 ) ? 'active' : '';
print '';
}
echo '
';
}
}
}
?>