Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function higher_education_featured_overall_image() {
- global $post, $wp_query;
- $options = higher_education_get_theme_options();
- $enable = $options['enable_featured_header_image'];
- // Check Enable/Disable header image in Page/Post Meta box
- if ( is_singular() ) {
- //Individual Page/Post Image Setting
- $metabox_feat_img = get_post_meta( $post->ID, 'higher-education-header-image', true );
- if ( 'disable' == $metabox_feat_img || ( 'default' == $metabox_feat_img && 'disabled' == $enable ) ) {
- echo '<!-- Page/Post Disable Header Image -->';
- return;
- } elseif ( 'enable' == $metabox_feat_img && 'disabled' == $enable ) {
- higher_education_featured_page_post_image();
- }
- }
- // Get Page ID outside Loop
- $page_id = $wp_query->get_queried_object_id();
- $page_for_posts = get_option( 'page_for_posts' );
- // Check Homepage
- if ( 'homepage' == $enable ) {
- if ( is_front_page() || ( is_home() && $page_for_posts != $page_id ) ) {
- higher_education_featured_image();
- }
- } elseif ( 'exclude-home' == $enable ) {
- if ( is_front_page() || ( is_home() && $page_for_posts != $page_id ) ) {
- return false;
- } else {
- higher_education_featured_image();
- }
- } elseif ( 'exclude-home-page-post' == $enable ) {
- if ( is_front_page() || ( is_home() && $page_for_posts != $page_id ) ) {
- return false;
- } elseif ( is_singular() ) {
- higher_education_featured_page_post_image();
- } else {
- higher_education_featured_image();
- }
- } elseif ( 'entire-site' == $enable ) {
- higher_education_featured_image();
- } elseif ( 'entire-site-page-post' == $enable ) {
- if ( is_singular() ) {
- higher_education_featured_page_post_image();
- } else {
- higher_education_featured_image();
- }
- } elseif ( 'pages-posts' == $enable ) {
- if ( is_singular() ) {
- higher_education_featured_page_post_image();
- }
- } else {
- echo '<!-- Disable Header Image -->';
- }
- } // higher_education_featured_overall_image
- add_action( 'higher_education_after_content', 'higher_education_featured_overall_image', 40 );
- function higher_education_hero_content_display() {
- //higher_education_flush_transients();
- global $wp_query;
- // get data value from options
- $options = higher_education_get_theme_options();
- $enable_content = $options['hero_content_option'];
- $content_select = $options['hero_content_type'];
- // Front page displays in Reading Settings
- $page_for_posts = get_option( 'page_for_posts' );
- // Get Page ID outside Loop
- $page_id = $wp_query->get_queried_object_id();
- if ( 'entire-site' == $enable_content || ( ( is_front_page() || ( is_home() && $page_for_posts != $page_id ) ) && 'homepage' == $enable_content ) ) {
- if ( ( !$output = get_transient( 'higher_education_hero_content' ) ) ) {
- echo '<!-- refreshing cache -->';
- $classes[] = $content_select ;
- $output ='
- <div id="hero-section" class="sections ' . implode( ' ', $classes ) . '">
- <div class="wrapper">';
- // Select content
- if ( 'demo' == $content_select ) {
- $output .= higher_education_demo_hero_content();
- }
- elseif ( 'post' == $content_select || 'page' == $content_select || 'category' == $content_select ) {
- $output .= higher_education_post_page_category_hero_content( $options );
- }
- elseif ( 'image' == $content_select ) {
- $output .= higher_education_custom_hero_content( $options );
- }
- $output .='
- </div><!-- .wrapper -->
- </div><!-- #hero-section -->';
- set_transient( 'higher_education_hero_content', $output, 86940 );
- }
- echo $output;
- }
- }
- add_action( 'higher_education_after_content', 'higher_education_hero_content_display', 50 );
- function higher_education_featured_content_display_position() {
- // Getting data from Theme Options
- $options = higher_education_get_theme_options();
- if ( $options['featured_content_position'] ) {
- add_action( 'higher_education_after_content', 'higher_education_featured_content_display', 60 );
- }
- else {
- add_action( 'higher_education_before_content', 'higher_education_featured_content_display', 30 );
- }
- }
- function higher_education_promotion_headline_display() {
- //higher_education_flush_transients();
- global $wp_query;
- $options = higher_education_get_theme_options();
- $enable_content = $options['promotion_headline_option'];
- $content_select = $options['promotion_headline_type'];
- // Front page displays in Reading Settings
- $page_for_posts = get_option( 'page_for_posts' );
- // Get Page ID outside Loop
- $page_id = $wp_query->get_queried_object_id();
- if ( 'entire-site' == $enable_content || ( ( is_front_page() || ( is_home() && $page_for_posts != $page_id ) ) && 'homepage' == $enable_content ) ) {
- if ( ( !$output = get_transient( 'higher_education_promotion_headline' ) ) ) {
- echo '<!-- refreshing cache -->';
- $classes[] = $content_select ;
- $output ='
- <div id="promotion-section" class="sections ' . implode( ' ', $classes ) . '">
- <div class="wrapper">';
- // Select content
- if ( 'demo' == $content_select ) {
- $output .= higher_education_demo_promotion_headline();
- }
- elseif ( 'post' == $content_select || 'page' == $content_select || 'category' == $content_select ) {
- $output .= higher_education_post_page_category_promotion_headline( $options );
- }
- elseif ( 'custom' == $content_select ) {
- $output .= higher_education_custom_promotion_headline( $options );
- }
- $output .='
- </div><!-- .wrapper -->
- </div><!-- #promotion-section -->';
- set_transient( 'higher_education_promotion_headline', $output, 86940 );
- }
- echo $output;
- }
- }
- add_action( 'higher_education_after_content', 'higher_education_promotion_headline_display', 70 );
- function higher_education_portfolio_display() {
- //higher_education_flush_transients();
- global $wp_query;
- // get data value from options
- $options = higher_education_get_theme_options();
- $enable_content = $options['portfolio_option'];
- $content_select = $options['portfolio_type'];
- // Front page displays in Reading Settings
- $page_for_posts = get_option( 'page_for_posts' );
- // Get Page ID outside Loop
- $page_id = $wp_query->get_queried_object_id();
- if ( 'entire-site' == $enable_content || ( ( is_front_page() || ( is_home() && $page_for_posts != $page_id ) ) && 'homepage' == $enable_content ) ) {
- if ( ( !$output = get_transient( 'higher_education_portfolio' ) ) ) {
- $layouts = $options['portfolio_layout'];
- $headline = $options['portfolio_headline'];
- $subheadline = $options['portfolio_subheadline'];
- echo '<!-- refreshing cache -->';
- if ( !empty( $layouts ) ) {
- $classes = $layouts ;
- }
- $classes .= ' ' . $content_select;
- if ( 'demo' == $content_select ) {
- $headline = esc_html__( 'Portfolio', 'higher-education-pro' );
- $subheadline = esc_html__( 'Here you can showcase the x number of Portfolios.', 'higher-education-pro' );
- }
- $output ='
- <div id="portfolio-section" class="sections ' . $classes . '">
- <div class="wrapper">';
- if ( !empty( $headline ) || !empty( $subheadline ) ) {
- $output .='
- <div class="section-heading-wrap">';
- if ( !empty( $headline ) ) {
- if( class_exists( 'Polylang' ) ) {
- $output .='<h2 class="section-title">'. pll__( $headline ) .'</h2>';
- } else {
- $output .='<h2 class="section-title">'. $headline .'</h2>';
- }
- }
- if ( !empty( $subheadline ) ) {
- if( class_exists( 'Polylang' ) ) {
- $output .='<p>'. pll__( $subheadline ) .'</p>';
- } else {
- $output .='<p>' . wp_kses_post( $subheadline ) . '</p>';
- }
- }
- $output .='
- </div><!-- .section-heading-wrap -->';
- }
- $output .='<div class="section-content-wrap">';
- // Select portfolio
- if ( 'demo' == $content_select ) {
- $output .= higher_education_demo_portfolio( $options );
- }
- elseif ( 'post' == $content_select || 'jetpack-portfolio' == $content_select || 'page' == $content_select || 'category' == $content_select ) {
- $output .= higher_education_post_page_category_portfolio( $options );
- }
- elseif ( 'image' == $content_select ) {
- $output .= higher_education_image_portfolio( $options );
- }
- if ( $options['portfolio_more_button_link'] || $options['portfolio_more_button_text'] ) {
- $target = $options['portfolio_more_button_target'] ? '_blank' : '_self';
- $output .='<span class="readmore"><a target="' . $target . '" href="' . esc_url( $options['portfolio_more_button_link'] ) . '">' . esc_html( $options['portfolio_more_button_text'] ) . '</a></span>';
- }
- $output .='
- </div><!-- .portfolio-content-wrap -->
- </div><!-- .wrapper -->
- </div><!-- .portfolio-section -->';
- set_transient( 'higher_education_portfolio', $output, 86940 );
- }
- echo $output;
- }
- } //higher_education_portfolio_display
- add_action( 'higher_education_after_content', 'higher_education_portfolio_display', 80 );
- function higher_education_logo_slider() {
- //higher_education_flush_transients();
- global $wp_query;
- // get data value from options
- $options = higher_education_get_theme_options();
- $enable_slider = $options['logo_slider_option'];
- $layout = $options['logo_slider_visible_items'];
- $slider_type = $options['logo_slider_type'];
- // Get Page ID outside Loop
- $page_id = $wp_query->get_queried_object_id();
- // Front page displays in Reading Settings
- $page_for_posts = get_option( 'page_for_posts' );
- if ( 'entire-site' == $enable_slider || ( ( is_front_page() || ( is_home() && $page_for_posts != $page_id ) ) && 'homepage' == $enable_slider ) ) {
- if ( ( !$output = get_transient( 'higher_education_logo_slider' ) ) ) {
- echo '<!-- refreshing cache -->';
- if ( 1 == $layout ) {
- $class[] = 'layout-one';
- }
- elseif ( 2 == $layout ) {
- $class[] = 'layout-two';
- }
- elseif ( 3 == $layout ) {
- $class[] = 'layout-three';
- }
- elseif ( 4 == $layout ) {
- $class[] = 'layout-four';
- }
- elseif ( 5 == $layout ) {
- $class[] = 'layout-five';
- }
- $class[] = $slider_type;
- $output = '
- <div id="logo-section" class="sections '. esc_attr( implode( ' ', $class ) ) .'">
- <div class="wrapper">';
- if ( '' != $options['logo_slider_title'] ) {
- if( class_exists( 'Polylang' ) ) {
- $options['logo_slider_title'] = pll__( $options['logo_slider_title'] );
- }
- $output .= '<h2 id="logo-slider-title" class="section-title">' . esc_html( $options['logo_slider_title'] ) . '</h2>';
- }
- $output .= '
- <!-- prev/next links -->
- <!-- prev/next links -->
- <div class="cycle-prev"></div>
- <div class="cycle-next"></div>
- <div class="logo_slider_content_slider_wrap cycle-slideshow"
- data-cycle-log="false"
- data-cycle-pause-on-hover="true"
- data-cycle-swipe="true"
- data-cycle-fx=carousel
- data-cycle-carousel-fluid=true
- data-cycle-carousel-visible="'. absint( $options['logo_slider_visible_items'] ) .'"
- data-cycle-speed="'. esc_attr( $options['logo_slider_transition_length'] ) * 1000 .'"
- data-cycle-timeout="'. esc_attr( $options['logo_slider_transition_delay'] ) * 1000 .'"
- data-cycle-prev=".cycle-prev"
- data-cycle-next=".cycle-next"
- data-cycle-slides="> article"
- >';
- if ( 'demo' == $slider_type ) {
- $output .= higher_education_demo_logo_slider();
- }
- elseif ( 'post' == $slider_type || 'page' == $slider_type || 'category' == $slider_type) {
- $output .= higher_education_post_page_category_logo_slider( $options );
- }
- else {
- $output .= higher_education_image_logo_slider( $options );
- }
- $output .= '
- </div><!-- .logo_slider_content_slider_wrap.cycle-slideshow -->
- </div><!-- .wrapper -->
- </div><!-- #slider-section -->';
- set_transient( 'higher_education_logo_slider', $output, 86940 );
- }
- echo $output;
- }
- }
- add_action( 'higher_education_after_content', 'higher_education_logo_slider', 80 );
- function higher_education_courses_display_position() {
- // Getting data from Theme Options
- $options = higher_education_get_theme_options();
- if ( $options['courses_position'] ) {
- add_action( 'higher_education_after_content', 'higher_education_courses_display', 90 );
- }
- else {
- add_action( 'higher_education_before_content', 'higher_education_courses_display', 70 );
- }
- }
- function higher_education_our_professors_display_position() {
- // Getting data from Theme Options
- $options = higher_education_get_theme_options();
- if ( $options['our_professors_position'] ) {
- add_action( 'higher_education_after_content', 'higher_education_our_professors_display', 100 );
- }
- else {
- add_action( 'higher_education_before_content', 'higher_education_our_professors_display', 80 );
- }
- }
- function higher_education_testimonial_display_position() {
- // Getting data from Theme Options
- $options = higher_education_get_theme_options();
- if ( $options['testimonial_position'] ) {
- add_action( 'higher_education_after_content', 'higher_education_testimonial_display', 110 );
- }
- else {
- add_action( 'higher_education_before_content', 'higher_education_testimonial_display', 90 );
- }
- }
- function higher_education_events_display_position() {
- // Getting data from Theme Options
- $options = higher_education_get_theme_options();
- if ( $options['events_position'] ) {
- add_action( 'higher_education_after_content', 'higher_education_events_display', 110 );
- }
- else {
- add_action( 'higher_education_before_content', 'higher_education_events_display', 100 );
- }
- }
- function higher_education_news_display_position() {
- // Getting data from Theme Options
- $options = higher_education_get_theme_options();
- if ( $options['news_position'] ) {
- add_action( 'higher_education_after_content', 'higher_education_news_display', 120 );
- }
- else {
- add_action( 'higher_education_before_content', 'higher_education_news_display', 110 );
- }
- }
- function remove_parent_action() {
- remove_action( 'higher_education_after_header', 'higher_education_featured_overall_image', 60 );
- remove_action( 'higher_education_before_content', 'higher_education_hero_content_display', 20 );
- remove_action( 'higher_education_after_content', 'higher_education_featured_content_display', 40 );
- remove_action( 'higher_education_before_content', 'higher_education_promotion_headline_display', 40 );
- remove_action( 'higher_education_before_content', 'higher_education_portfolio_display', 50);
- remove_action( 'higher_education_before_content', 'higher_education_logo_slider', 60 );
- remove_action( 'higher_education_after_content', 'higher_education_courses_display', 50 );
- remove_action( 'higher_education_after_content', 'higher_education_our_professors_display', 60 );
- remove_action( 'higher_education_after_content', 'higher_education_testimonial_display', 70 );
- remove_action( 'higher_education_after_content', 'higher_education_events_display', 80 );
- remove_action( 'higher_education_after_content', 'higher_education_news_display', 90 );
- }
- add_action( 'init', 'remove_parent_action');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement