'nova_menu_item', 'post__in' => $ids, 'orderby' => 'post__in', 'posts_per_page' => absint( $no_of_menu_items ), ); // Fetch posts. $all_posts = get_posts( $qargs ); $today_special = array(); if ( ! empty( $all_posts ) ) { $cnt = 0; foreach ( $all_posts as $key => $post ) { $today_special[ $cnt ]['food_item_name'] = $post->post_title; $today_special[ $cnt ]['price'] = get_post_meta( $post->ID, 'nova_price', true ); $today_special[ $cnt ]['url'] = get_permalink( $post->ID ); $cnt++; } } if ( ! empty( $today_special ) ) { $input = $today_special; } } break; default: break; } return $input ; } endif; if ( ! function_exists( 'foodland_add_today_special' ) ) : /** * Add today special. * * @since Foodland 0.2 */ function foodland_add_today_special() { $flag_apply_content = apply_filters( 'foodland_filter_today_special_status', false ); if ( true !== $flag_apply_content ) { return false; } $content_details = array(); $content_details = apply_filters( 'foodland_filter_today_special_details', $content_details ); if ( empty( $content_details ) ) { return; } // Render today special now. foodland_render_today_special( $content_details ); } endif; if ( ! function_exists( 'foodland_render_today_special' ) ) : /** * Render today special. * * @since Foodland 0.2 * * @param array $content_details of today special. */ function foodland_render_today_special( $content_details = array() ) { if ( empty( $content_details ) ) { return; } $options = foodland_get_theme_options(); $today_special_type = $options['todays_special_type']; if( !empty( $options['todays_special_menu_banner'] ) ){ $class = 'one-half '; $banner_image_id = absint( $options['todays_special_menu_banner'] ); $banner_image = wp_get_attachment_image( $banner_image_id, array( 570,379 ) ); } else{ $class = ''; $banner_image = ''; } if( ( ! $foodland_today_special = get_transient( 'foodland_special_product' ) ) ) { echo ''; $foodland_today_special = ''; $foodland_today_special .= ' '; set_transient( 'foodland_special_product', $foodland_today_special, 86940 ); } echo $foodland_today_special; } endif; if( ! function_exists( 'foodland_today_special_status' ) ) : /** * Check status of today special. * * @since Foodland 0.2 */ function foodland_today_special_status( $input ) { global $post, $wp_query; $options = foodland_get_theme_options(); // today special status. $today_special_status = $options[ 'show_todays_special_on' ]; // Get Page ID outside Loop. $page_id = $wp_query->get_queried_object_id(); // Front page displays in Reading Settings. $page_on_front = absint( get_option( 'page_on_front' ) ); $page_for_posts = absint( get_option( 'page_for_posts' ) ); switch ( $today_special_status ) { case 'homepage': if ( $page_on_front === $page_id && $page_on_front > 0 ) { $input = true; } break; case 'disabled': $input = false; break; default: break; } return $input; } endif;