$slide1_image_url, 'slide_title' => $slide1_title, 'slide_desc' => $slide1_desc, 'slide_link' => $slide1_link ), array( 'slide_image_url' => $slide2_image_url, 'slide_title' => $slide2_title, 'slide_desc' => $slide2_desc, 'slide_link' => $slide2_link ), array( 'slide_image_url' => $slide3_image_url, 'slide_title' => $slide3_title, 'slide_desc' => $slide3_desc, 'slide_link' => $slide3_link ), ); foreach ($astronomy_homepage_sliderpage as $slide) { if ( ! empty( $slide['slide_image_url'] ) ) { // Get url of background image or set video overlay image $slide_image = 'background: url(' . esc_url( $slide['slide_image_url'] ) . ') no-repeat center; background-size: cover;'; // Used for slider image alt text if ( ! empty( $slide['slide_title'] ) ) { $slide_alt = $slide['slide_title']; } else { $slide_alt = __( 'Slider Image', 'astronomy' ); } echo '
  • ', '' . esc_attr( $slide_alt ) . '', '
    ', '
    ', '
    ', '', '
    ', '
    ', '
    ', '
  • '; } } } // Add Slider - Homepage function astronomy_input_sliderhome() { // Get theme options values. $astronomy_homepage_sliderswitch = astronomy_var ( 'astronomy_homepage_sliderswitch' ); $astronomy_homepage_sliderimage1_image = astronomy_var ( 'astronomy_homepage_sliderimage1_image' ); $astronomy_homepage_sliderimage2_image = astronomy_var ( 'astronomy_homepage_sliderimage2_image' ); $astronomy_homepage_sliderimage3_image = astronomy_var ( 'astronomy_homepage_sliderimage3_image' ); $astronomy_class_fullwidth = NULL; $slide_image = NULL; $slider_default = NULL; if ( is_front_page() ) { // Set default slider $slider_default .= '
  • ' . esc_attr__( 'Demo Image', 'astronomy' ) . '
  • '; $slider_default .= '
  • ' . esc_attr__( 'Demo Image', 'astronomy' ) . '
  • '; $slider_default .= '
  • ' . esc_attr__( 'Demo Image', 'astronomy' ) . '
  • '; if ( ( current_user_can( 'edit_theme_options' ) and empty( $astronomy_homepage_sliderswitch ) ) or $astronomy_homepage_sliderswitch == 'option1' ) { echo '
    '; echo '
      '; echo $slider_default; echo '
    '; echo '
    '; } else if ( $astronomy_homepage_sliderswitch == 'option2' ) { echo ''; } else if ( $astronomy_homepage_sliderswitch == 'option3' ) { echo ''; } else if ( $astronomy_homepage_sliderswitch == 'option4' ) { // Check if page slider has been set if( empty( $astronomy_homepage_sliderimage1_image ) and empty( $astronomy_homepage_sliderimage2_image ) and empty( $astronomy_homepage_sliderimage3_image ) ) { echo '
    '; echo '
      '; echo $slider_default; echo '
    '; echo '
    '; } else { echo '
    '; echo '
      '; astronomy_input_sliderhomepage(); echo '
    '; echo '
    '; } } } } // Add AstronomySlider Height - Homepage function astronomy_input_sliderhomeheight() { // Get theme options values. $astronomy_homepage_sliderswitch = astronomy_var ( 'astronomy_homepage_sliderswitch' ); $astronomy_homepage_sliderpresetheight = astronomy_var ( 'astronomy_homepage_sliderpresetheight' ); if ( empty( $astronomy_homepage_sliderpresetheight ) ) $astronomy_homepage_sliderpresetheight = '350'; if ( is_front_page() ) { if ( empty( $astronomy_homepage_sliderswitch ) or $astronomy_homepage_sliderswitch == 'option1' or $astronomy_homepage_sliderswitch == 'option4' ) { echo "\n" .'' . "\n"; } } } add_action( 'wp_head','astronomy_input_sliderhomeheight', '13' ); //---------------------------------------------------------------------------------- // ENABLE HOMEPAGE CONTENT //---------------------------------------------------------------------------------- function astronomy_input_homepagesection() { // Get theme options values. $astronomy_homepage_sectionswitch = astronomy_var ( 'astronomy_homepage_sectionswitch' ); $astronomy_homepage_section1_icon = astronomy_var ( 'astronomy_homepage_section1_icon' ); $astronomy_homepage_section1_title = astronomy_var ( 'astronomy_homepage_section1_title' ); $astronomy_homepage_section1_desc = astronomy_var ( 'astronomy_homepage_section1_desc' ); $astronomy_homepage_section1_link = astronomy_var ( 'astronomy_homepage_section1_link' ); $astronomy_homepage_section1_url = astronomy_var ( 'astronomy_homepage_section1_url' ); $astronomy_homepage_section1_button = astronomy_var ( 'astronomy_homepage_section1_button' ); $astronomy_homepage_section2_icon = astronomy_var ( 'astronomy_homepage_section2_icon' ); $astronomy_homepage_section2_title = astronomy_var ( 'astronomy_homepage_section2_title' ); $astronomy_homepage_section2_desc = astronomy_var ( 'astronomy_homepage_section2_desc' ); $astronomy_homepage_section2_link = astronomy_var ( 'astronomy_homepage_section2_link' ); $astronomy_homepage_section2_url = astronomy_var ( 'astronomy_homepage_section2_url' ); $astronomy_homepage_section2_button = astronomy_var ( 'astronomy_homepage_section2_button' ); $astronomy_homepage_section3_icon = astronomy_var ( 'astronomy_homepage_section3_icon' ); $astronomy_homepage_section3_title = astronomy_var ( 'astronomy_homepage_section3_title' ); $astronomy_homepage_section3_desc = astronomy_var ( 'astronomy_homepage_section3_desc' ); $astronomy_homepage_section3_link = astronomy_var ( 'astronomy_homepage_section3_link' ); $astronomy_homepage_section3_url = astronomy_var ( 'astronomy_homepage_section3_url' ); $astronomy_homepage_section3_button = astronomy_var ( 'astronomy_homepage_section3_button' ); // Set default values for icons if ( empty( $astronomy_homepage_section1_icon ) ) $astronomy_homepage_section1_icon = __( 'fa fa-thumbs-up', 'astronomy' ); if ( empty( $astronomy_homepage_section2_icon ) ) $astronomy_homepage_section2_icon = __( 'fa fa-desktop', 'astronomy' ); if ( empty( $astronomy_homepage_section3_icon ) ) $astronomy_homepage_section3_icon = __( 'fa fa-gears', 'astronomy' ); // Set default values for titles if ( empty( $astronomy_homepage_section1_title ) ) $astronomy_homepage_section1_title = __( 'Step 1 - Theme Options', 'astronomy' ); if ( empty( $astronomy_homepage_section2_title ) ) $astronomy_homepage_section2_title = __( 'Step 2 - Setup Slider', 'astronomy' ); if ( empty( $astronomy_homepage_section3_title ) ) $astronomy_homepage_section3_title = __( 'Step 3 - Create Homepage', 'astronomy' ); // Set default values for descriptions if ( empty( $astronomy_homepage_section1_desc ) ) $astronomy_homepage_section1_desc = __( 'To begin customizing your site go to Appearance -> Customizer and select Theme Options. Here's you'll find custom options to help build your site.', 'astronomy' ); if ( empty( $astronomy_homepage_section2_desc ) ) $astronomy_homepage_section2_desc = __( 'To add a slider go to Theme Options -> Homepage and choose page slider. The slider will use the page title, excerpt and featured image for the slides.', 'astronomy' ); if ( empty( $astronomy_homepage_section3_desc ) ) $astronomy_homepage_section3_desc = __( 'To add featured content go to Theme Options -> Homepage (Featured) and turn the switch on then add the content you want for each section.', 'astronomy' ); // Get page names for links if ( ! empty( $astronomy_homepage_section1_url ) ) { $astronomy_homepage_section1_link = $astronomy_homepage_section1_url; } else if ( ! empty( $astronomy_homepage_section1_link ) ) { $astronomy_homepage_section1_link = get_permalink( $astronomy_homepage_section1_link ); } if ( ! empty( $astronomy_homepage_section2_url ) ) { $astronomy_homepage_section2_link = $astronomy_homepage_section2_url; } else if ( ! empty( $astronomy_homepage_section2_link ) ) { $astronomy_homepage_section2_link = get_permalink( $astronomy_homepage_section2_link ); } if ( ! empty( $astronomy_homepage_section3_url ) ) { $astronomy_homepage_section3_link = $astronomy_homepage_section3_url; } else if ( ! empty( $astronomy_homepage_section3_link ) ) { $astronomy_homepage_section3_link = get_permalink( $astronomy_homepage_section3_link ); } // Get button text if ( empty( $astronomy_homepage_section1_button ) ) $astronomy_homepage_section1_button = __( 'Read More', 'astronomy' ); if ( empty( $astronomy_homepage_section2_button ) ) $astronomy_homepage_section2_button = __( 'Read More', 'astronomy' ); if ( empty( $astronomy_homepage_section3_button ) ) $astronomy_homepage_section3_button = __( 'Read More', 'astronomy' ); // Output featured content areas if ( is_front_page() ) { if ( ( current_user_can( 'edit_theme_options' ) and empty( $astronomy_homepage_sectionswitch ) ) or $astronomy_homepage_sectionswitch == '1' ) { echo '
    '; echo '
    ', '
    ', '
    '; if ( empty( $astronomy_homepage_section1_icon ) ) { echo ''; } else { if ( ! empty( $astronomy_homepage_section1_link ) ) { echo ''; } else { echo ''; } } echo '
    ', '
    ', '

    ' . esc_html( $astronomy_homepage_section1_title ) . '

    ' . wpautop( do_shortcode( wp_strip_all_tags( esc_html( $astronomy_homepage_section1_desc ) ) ) ); if ( ! empty( $astronomy_homepage_section1_link ) ) { echo '

    ' . esc_html( $astronomy_homepage_section1_button ) . '

    '; } echo '
    ', '
    ', '
    '; echo '
    ', '
    ', '
    '; if ( empty( $astronomy_homepage_section2_icon ) ) { echo ''; } else { if ( ! empty( $astronomy_homepage_section2_link ) ) { echo ''; } else { echo ''; } } echo '
    ', '
    ', '

    ' . esc_html( $astronomy_homepage_section2_title ) . '

    ' . wpautop( do_shortcode( wp_strip_all_tags( esc_html( $astronomy_homepage_section2_desc ) ) ) ); if ( ! empty( $astronomy_homepage_section2_link ) ) { echo '

    ' . esc_html( $astronomy_homepage_section2_button ) . '

    '; } echo '
    ', '
    ', '
    '; echo '
    ', '
    ', '
    '; if ( empty( $astronomy_homepage_section3_icon ) ) { echo ''; } else { if ( ! empty( $astronomy_homepage_section3_link ) ) { echo ''; } else { echo ''; } } echo '
    ', '
    ', '

    ' . esc_html( $astronomy_homepage_section3_title ) . '

    ' . wpautop( do_shortcode( wp_strip_all_tags( esc_html( $astronomy_homepage_section3_desc ) ) ) ); if ( ! empty( $astronomy_homepage_section3_link ) ) { echo '

    ' . esc_html( $astronomy_homepage_section3_button ) . '

    '; } echo '
    ', '
    ', '
    '; echo '
    '; } } } /* ---------------------------------------------------------------------------------- CALL TO ACTION - INTRO ---------------------------------------------------------------------------------- */ function astronomy_input_ctaintro() { // Get theme options values. $astronomy_homepage_introswitch = astronomy_var ( 'astronomy_homepage_introswitch' ); $astronomy_homepage_introstyle = astronomy_var ( 'astronomy_homepage_introstyle' ); $astronomy_homepage_introaction = astronomy_var ( 'astronomy_homepage_introaction' ); $astronomy_homepage_introactionteaser = astronomy_var ( 'astronomy_homepage_introactionteaser' ); $astronomy_homepage_introactiontext1 = astronomy_var ( 'astronomy_homepage_introactiontext1' ); $astronomy_homepage_introactionlink1 = astronomy_var ( 'astronomy_homepage_introactionlink1' ); $astronomy_homepage_introactionpage1 = astronomy_var ( 'astronomy_homepage_introactionpage1' ); $astronomy_homepage_introactioncustom1 = astronomy_var ( 'astronomy_homepage_introactioncustom1' ); if ( $astronomy_homepage_introswitch == '1' and is_front_page() and ! empty( $astronomy_homepage_introaction ) ) { // Determine style for call to action if ( empty( $astronomy_homepage_introstyle ) or $astronomy_homepage_introstyle == 'option1' ) { $style = 'style1'; $class = NULL; $wrap_start = NULL; $wrap_end = NULL; } else if ( $astronomy_homepage_introstyle == 'option2' ) { $style = 'style2'; $class = ' one_third last'; $wrap_start = '
    '; $wrap_end = '
    '; } echo '
    '; echo $wrap_start; echo '
    ', '

    ' . esc_html( $astronomy_homepage_introaction ) . '

    ', '
    '; echo '
    ', wpautop( esc_html( $astronomy_homepage_introactionteaser ) ), '
    '; echo $wrap_end; if ( ( !empty( $astronomy_homepage_introactionlink1) and $astronomy_homepage_introactionlink1 !== 'option3' ) ) { // Set default value of buttons to "Read more" if( empty( $astronomy_homepage_introactiontext1 ) ) { $astronomy_homepage_introactiontext1 = __( 'Read More', 'astronomy' ); } echo '
    '; // Add call to action button 1 if ( $astronomy_homepage_introactionlink1 == 'option1' ) { echo '', esc_html( $astronomy_homepage_introactiontext1 ), ''; } else if ( $astronomy_homepage_introactionlink1 == 'option2' ) { echo '', esc_html( $astronomy_homepage_introactiontext1 ), ''; } echo '
    '; } echo '
    '; } } ?>