-
-
Save freezvd/f914d0e3e6832f7ea46c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Add slider | |
------------------------------------------------------------ */ | |
add_action('genesis_after_header', 'jm_home_slider'); | |
function jm_home_slider() { | |
echo '<div id="featured-slider">'; | |
echo '<div class="flexslider">'; | |
echo '<ul class="slides">'; | |
$args = array( | |
'post_type' => 'slide', | |
'order' => 'DESC', | |
); | |
$tips = new WP_Query( $args ); | |
if( $tips->have_posts() ): | |
while ( $tips->have_posts() ) : $tips->the_post(); | |
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); | |
echo '<li class="slide'; | |
echo '" style="background:center top url('.$image[0].'); background-size: cover; height:'. $image[2].'px;"'; | |
echo '>'; | |
echo '<div class="flex-caption"><div class="wrap">'. apply_filters('the_content',get_the_content()) .'</div></div>'; | |
endwhile; | |
endif; | |
wp_reset_postdata(); | |
echo '</ul>'; | |
echo '</div>'; | |
echo '</div>'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Enqueue scripts | |
------------------------------------------------------------ */ | |
add_action( 'wp_enqueue_scripts', 'frame_front_page_enqueue_scripts' ); | |
function frame_front_page_enqueue_scripts() { | |
wp_enqueue_script('flexslider', get_stylesheet_directory_uri().'/lib/js/jquery.flexslider-min.js', array('jquery'), '2.1', TRUE); | |
wp_enqueue_style('flexslider-style', get_stylesheet_directory_uri().'/lib/js/flexslider.css','flexslider','2.1'); | |
wp_enqueue_script('flexslider-init', get_stylesheet_directory_uri().'/lib/js/flexslider-init.js', array('jquery'), '2.1', TRUE); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment