'', 'default-repeat' => 'repeat', 'default-position-x' => 'center', 'default-attachment' => 'scroll', 'admin-head-callback' => '', 'admin-preview-callback' => '' )); add_theme_support( 'custom-background', $defaults ); /** * Add theme support for site logo * * Since wordpress 4.5 */ if( 4.5 <= ( float )get_bloginfo( 'version' ) ){ add_theme_support( 'custom-logo', array( 'flex-width' => true, 'flex-height' => false, 'width' => 250, 'height' => 50, 'header-text' => array( 'site-title', 'site-description' ), ) ); } /** * Enable support for Post Thumbnails on posts and pages * * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails */ add_theme_support( 'post-thumbnails' ); // Add Foodland's custom image sizes add_image_size( 'foodland-slider', 450, 315, true ); // Used for Featured slider add_image_size( 'foodland-featured-content', 336, 224, true ); // used in Featured Content add_image_size( 'foodland-promotional-page',570, 380, true ); // Used in Promotional headline page thumbnail image add_image_size( 'foodland-staff-member-image',250, 240, true ); // Used in staff member images //Archive Images add_image_size( 'foodland-archive-left-right', 480, 318, true ); // used in Archive Left/Right image if( class_exists( 'jetpack' ) ){ add_theme_support( 'nova_menu_item' ); // add theme support for food items. add_image_size( 'foodland-nova-archive',570, 500, true ); // Used in Nova Menu Archive page images } /** * This theme uses wp_nav_menu() in one location. */ register_nav_menus( array( 'primary' => __( 'Primary Menu', 'foodland' ), ) ); /** * Enable support for Post Formats */ add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) ); /** * Setup Editor style */ add_editor_style( 'css/editor-style.css' ); /** * Setup title support for theme * Supported from WordPress version 4.1 onwards * More Info: https://make.wordpress.org/core/2014/10/29/title-tags-in-4-1/ */ add_theme_support( 'title-tag' ); // Gutenberg support add_theme_support( 'editor-color-palette', array( array( 'name' => esc_html__( 'Blue', 'foodland' ), 'slug' => 'blue', 'color' => '#2c7dfa', ), array( 'name' => esc_html__( 'Green', 'foodland' ), 'slug' => 'green', 'color' => '#7ed221', ), array( 'name' => esc_html__( 'Golden', 'foodland' ), 'slug' => 'golden', 'color' => '#ce9b23', ), array( 'name' => esc_html__( 'Black', 'foodland' ), 'slug' => 'black', 'color' => '#2f3633', ), array( 'name' => esc_html__( 'Grey', 'foodland' ), 'slug' => 'grey', 'color' => '#82868b', ), )); add_theme_support( 'align-wide' ); add_theme_support( 'editor-font-sizes', array( array( 'name' => esc_html__( 'small', 'foodland' ), 'shortName' => esc_html__( 'S', 'foodland' ), 'size' => 12, 'slug' => 'small' ), array( 'name' => esc_html__( 'regular', 'foodland' ), 'shortName' => esc_html__( 'M', 'foodland' ), 'size' => 16, 'slug' => 'regular' ), array( 'name' => esc_html__( 'larger', 'foodland' ), 'shortName' => esc_html__( 'L', 'foodland' ), 'size' => 36, 'slug' => 'larger' ), array( 'name' => esc_html__( 'huge', 'foodland' ), 'shortName' => esc_html__( 'XL', 'foodland' ), 'size' => 48, 'slug' => 'huge' ) )); add_theme_support('editor-styles'); add_theme_support( 'wp-block-styles' ); } endif; // foodland_setup add_action( 'after_setup_theme', 'foodland_setup' ); /** * Enqueue scripts and styles * * @uses wp_register_script, wp_enqueue_script, wp_register_style, wp_enqueue_style, wp_localize_script * @action wp_enqueue_scripts * * @since Foodland 0.2 */ function foodland_scripts() { $options = foodland_get_theme_options(); $web_fonts_stylesheet = 'https://fonts.googleapis.com/css?family=Roboto'; wp_register_style( 'foodland-web-font', $web_fonts_stylesheet, false, null ); $foodland_deps = array( 'foodland-web-font' ); /** * Adds JavaScript to pages with the comment form to support * sites with threaded comments (when in use). */ if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } //For genericons wp_enqueue_style( 'foodland-genericons', get_template_directory_uri() . '/css/genericons.min.css', false, '3.4.1' ); //For Meanmenu wp_enqueue_style( 'foodland-meanmenu', get_template_directory_uri() . '/css/meanmenu.min.css', false, '3.4.1' ); // blocks wp_enqueue_style( 'foodland-blocks', get_template_directory_uri() . '/css/blocks.css' ); // enqueue styles required for the theme wp_enqueue_style( 'foodland-style', get_stylesheet_uri(), $foodland_deps, FOODLAND_THEME_VERSION ); // Enqueue scripts required for the theme wp_enqueue_script( 'skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.min.js', array(), '20130115', true ); // Enqueue meanmenu wp_enqueue_script( 'jquery-meanmenu', get_template_directory_uri() . '/js/jquery.meanmenu.min.js', array('jquery'), '20130115', true ); /** * Loads up Scroll Up script */ wp_enqueue_script( 'jquery-scrollup', get_template_directory_uri() . '/js/foodland-scrollup.min.js', array( 'jquery' ), '20160309', true ); /** * Loads up fit vids */ wp_enqueue_script( 'jquery-fitvids', get_template_directory_uri() . '/js/fitvids.min.js', array( 'jquery' ), '1.1', true ); /** * Loads up html5.min for IE support */ wp_enqueue_script( 'html5', get_template_directory_uri() . '/js/html5.min.js' ); wp_script_add_data( 'html5', 'conditional', 'lt IE 9' ); /** * Loads up Cycle JS */ if( $options['featured_slider_option'] != 'disabled' ) { // Load cycle2.css wp_enqueue_style( 'cycle2-style', get_template_directory_uri() . '/css/cycle2.min.css' ); // Load cycle2.min.js wp_enqueue_script( 'jquery-cycle2', get_template_directory_uri() . '/js/jquery-cycle2.min.js', array( 'jquery' ), '2.1.6', true ); // Load cycle2-carousel.min.js wp_enqueue_script( 'jquery-cycle2-carousel', get_template_directory_uri() . '/js/jquery-cycle2-carousel.min.js', array( 'jquery-cycle2' ), false , true ); } /** * Enqueue custom script for foodland. */ wp_enqueue_script( 'foodland-custom-scripts', get_template_directory_uri() . '/js/foodland-custom-scripts.min.js', array( 'jquery' ), null ); } add_action( 'wp_enqueue_scripts', 'foodland_scripts' ); /** * Enqueue editor styles for Gutenberg * * @since Foodland 1.0.0 */ function foodland_block_editor_styles() { // Block styles. wp_enqueue_style( 'foodland-block-editor-style', get_theme_file_uri( '/css/editor-blocks.css' ) ); } add_action( 'enqueue_block_editor_assets', 'foodland_block_editor_styles' ); /** * Recommended plugins */ require_once get_template_directory() . '/lib/class-tgm-plugin-activation.php'; require_once get_template_directory() . '/inc/tgm.php'; /** * Default Options. */ require get_template_directory() . '/inc/default-options.php'; /** * Custom Header. */ require get_template_directory() . '/inc/custom-header.php'; /** * Structure for foodland */ require get_template_directory() . '/inc/structure.php'; /** * Customizer additions. */ require get_template_directory() . '/inc/customizer-includes/customizer.php'; /** * Custom Menus */ require get_template_directory() . '/inc/menus.php'; /** * Load Slider file. */ require get_template_directory() . '/inc/featured-slider.php'; /** * Load promotional headline file. */ require get_template_directory() . '/inc/promotional-headline.php'; /** * Load Special product if jetpack plugin is active */ if( class_exists( 'jetpack' ) ){ require get_template_directory() . '/inc/todays-special.php'; } /** * Load Featured Content. */ require get_template_directory() . '/inc/featured-content.php'; /** * Load Team members */ require get_template_directory() . '/inc/team-members.php'; /** * Load custom template for nova resturant jetpack. */ if ( class_exists( 'Nova_Restaurant' ) ) { require get_template_directory() . '/inc/custom-jetpack-template.php'; } /** * Load Widgets and Sidebars */ require get_template_directory() . '/inc/widget-includes/widgets-core.php'; /** * Load Social Icons */ require get_template_directory() . '/inc/social-icons.php'; /** * Returns the options array for foodland. * @uses get_theme_mod * * @since Foodland 0.2 */ function foodland_get_theme_options() { $foodland_default_options = foodland_get_default_theme_options(); return array_merge( $foodland_default_options , get_theme_mod( 'foodland_theme_options', $foodland_default_options ) ) ; } /** * Flush out all transients * * @uses delete_transient * * @action customize_save, foodland_customize_preview (see foodland_customizer function: foodland_customize_preview) * * @since Foodland 0.2 */ function foodland_flush_transients(){ delete_transient( 'foodland_featured_slider' ); delete_transient( 'foodland_promotional_headline' ); delete_transient( 'foodland_featured_content' ); delete_transient( 'foodland_special_product' ); delete_transient( 'foodland_team_members' ); delete_transient( 'foodland_footer_content' ); delete_transient( 'foodland_custom_css' ); delete_transient( 'foodland_featured_image' ); delete_transient( 'foodland_social_icons' ); delete_transient( 'foodland_post_total_category' ); //Add foodland default themes if there is no values if ( !get_theme_mod('foodland_theme_options') ) { set_theme_mod( 'foodland_theme_options', foodland_get_default_theme_options() ); } } add_action( 'customize_save', 'foodland_flush_transients' ); /** * Flush out category transients * * @uses delete_transient * * @action edit_category * * @since Foodland 0.2 */ function foodland_flush_category_transients(){ delete_transient( 'foodland_post_total_category' ); } add_action( 'edit_category', 'foodland_flush_category_transients' ); /** * Flush out post related transients * * @uses delete_transient * * @action save_post * * @since Foodland 0.2 */ function foodland_flush_post_transients(){ delete_transient( 'foodland_featured_slider' ); delete_transient( 'foodland_promotional_headline' ); delete_transient( 'foodland_special_product' ); delete_transient( 'foodland_featured_content' ); delete_transient( 'foodland_featured_image' ); delete_transient( 'foodland_post_total_category' ); } add_action( 'save_post', 'foodland_flush_post_transients' ); if ( ! function_exists( 'foodland_custom_css' ) ) : /** * Enqueue Custon CSS * * @uses set_transient, wp_head, wp_enqueue_style * * @action wp_enqueue_scripts * * @since Foodland 0.2 */ function foodland_custom_css() { //foodland_flush_transients(); $options = foodland_get_theme_options(); $defaults = foodland_get_default_theme_options(); if ( ( !$foodland_custom_css = get_transient( 'foodland_custom_css' ) ) ) { $foodland_custom_css =''; // Header Color Options if( $defaults[ 'site_title_tagline_color' ] != get_header_textcolor() ) { $foodland_custom_css .= "#masthead .site-title a, .site-description{ color: #". get_header_textcolor() ."; }". "\n"; } // Header Navigation menu if( $defaults[ 'header_nav_menu_color' ] != $options[ 'header_nav_menu_color' ] ){ $foodland_custom_css .= "#site-navigation ul li a{ color: ". $options['header_nav_menu_color'] ."; }" . "\n"; } $css = ''; // Check if the custom CSS feature of 4.7 exists if ( function_exists( 'wp_update_custom_css_post' ) ) { // Migrate any existing theme CSS to the core option added in WordPress 4.7. if( !empty( $options['custom_css'] ) ) $css = $options['custom_css']; if ( $css ) { $core_css = wp_get_custom_css(); // Preserve any CSS already added to the core option. $return = wp_update_custom_css_post( $core_css . $css ); if ( ! is_wp_error( $return ) ) { // Remove the old theme_mod, so that the CSS is stored in only one place moving forward. $options['custom_css'] = ''; set_theme_mod( 'foodland_theme_options', $options ); } } } else { // Back-compat for WordPress < 4.7. if ( isset( $options['custom_css'] ) ) { $foodland_custom_css .= $options['custom_css']; } } set_transient( 'foodland_custom_css', htmlspecialchars_decode( $foodland_custom_css ), 86940 ); } wp_add_inline_style( 'foodland-style', $foodland_custom_css ); } endif; //foodland_custom_css add_action( 'wp_enqueue_scripts', 'foodland_custom_css', 10 ); if ( ! function_exists( 'foodland_content_nav' ) ) : /** * Display navigation to next/previous pages when applicable * * @since Foodland 0.2 */ function foodland_content_nav( $nav_id ) { global $wp_query, $post; // Don't print empty markup on single pages if there's nowhere to navigate. if ( is_single() ) { $previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) return; } // Don't print empty markup in archives if there's only one page. if ( $wp_query->max_num_pages < 2 && ( is_home() || is_archive() || is_search() ) ) { return; } $options = foodland_get_theme_options(); $nav_class = ( is_single() ) ? 'site-navigation post-navigation' : 'site-navigation paging-navigation'; ?> comment_type || 'trackback' == $comment->comment_type ) : ?>
  • >
    ', '' ); ?>
  • >
    %s', esc_url( get_comment_author_url() ), get_avatar( $comment, $args['avatar_size'] ) . '' ); } ?>
    %s', esc_html( get_comment_author() ) ); ?> ', '' ); ?>
    comment_approved ) : ?>

    $post->post_parent, 'fields' => 'ids', 'numberposts' => 1, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ); // If there is more than 1 attachment in a gallery... if ( count( $attachment_ids ) > 1 ) { foreach ( $attachment_ids as $attachment_id ) { if ( $attachment_id == $post->ID ) { $next_id = current( $attachment_ids ); break; } } // get the URL of the next image attachment... if ( $next_id ) $next_attachment_url = get_attachment_link( $next_id ); // or get the URL of the first image attachment. else $next_attachment_url = get_attachment_link( array_shift( $attachment_ids ) ); } printf( '%3$s', esc_url( $next_attachment_url ), esc_attr( the_title_attribute( array( 'echo' => false ) ) ), wp_get_attachment_image( $post->ID, $attachment_size ) ); } endif; //foodland_the_attached_image if ( ! function_exists( 'foodland_entry_meta' ) ) : /** * Prints HTML with meta information for the current post-date/time and author. * * @since Foodland 0.2 */ function foodland_entry_meta() { echo '
    '; $time_string = ''; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = ''; } $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); printf( '' . __( 'posted on ', 'foodland') . '%1$s%3$s', sprintf( ''. _x( 'Posted on', 'Used before publish date.', 'foodland' ). ''), esc_url( get_day_link( get_the_time('Y'),get_the_time('m'), get_the_time('d') ) ), $time_string ); if ( is_singular() || is_multi_author() ) { printf( '', sprintf( '' . _x( 'Author', 'Used before post author name.', 'foodland' ) . '' ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_html( get_the_author() ) ); } echo '
    '; } endif; //foodland_entry_meta if ( ! function_exists( 'foodland_tag_category' ) ) : /** * Prints HTML with meta information for the categories, tags. * * @since Foodland 0.2 */ function foodland_tag_category() { echo '

    '; if ( 'post' == get_post_type() ) { $categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'foodland' ) ); if ( $categories_list && foodland_categorized_blog() ) { printf( '%1$s' . __( 'posted in', 'foodland') . ' %2$s', sprintf( '' . _x( 'Categories','Used before category names.', 'foodland' ) .'' ), $categories_list ); } $tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'foodland' ) ); if ( $tags_list ) { printf( '%1$s%2$s', sprintf( '' ._x( 'Tags', 'Used before tag names.', 'foodland'). '' ), $tags_list ); } if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) { echo ''; comments_popup_link( esc_html__( ' Leave a comment', 'foodland' ), esc_html__( '1 Comment', 'foodland' ), esc_html__( '% Comments', 'foodland' ) ); echo ''; } edit_post_link( esc_html__( ' Edit', 'foodland' ), '', '' ); } echo '

    '; } endif; //foodland_tag_category /** * Returns true if a blog has more than 1 category * * @since Foodland 0.2 */ function foodland_categorized_blog() { if ( false === ( $foodland_post_total_category = get_transient( 'foodland_post_total_category' ) ) ) { // Create an array of all the categories that are attached to posts $foodland_post_total_category = get_categories( array( 'hide_empty' => 1, ) ); // Count the number of categories that are attached to the posts $foodland_post_total_category = count( $foodland_post_total_category ); set_transient( 'foodland_post_total_category', $foodland_post_total_category ); } if ( '1' != $foodland_post_total_category ) { // This blog has more than 1 category so foodland_categorized_blog should return true return true; } else { // This blog has only 1 category so foodland_categorized_blog should return false return false; } } /** * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link. * * @since Foodland 0.2 */ function foodland_page_menu_args( $args ) { $args['show_home'] = true; return $args; } add_filter( 'wp_page_menu_args', 'foodland_page_menu_args' ); /** * Filter in a link to a content ID attribute for the next/previous image links on image attachment pages * * @since Foodland 0.2 */ function foodland_enhanced_image_navigation( $url, $id ) { if ( ! is_attachment() && ! wp_attachment_is_image( $id ) ) return $url; $image = get_post( $id ); if ( ! empty( $image->post_parent ) && $image->post_parent != $id ) $url .= '#main'; return $url; } add_filter( 'attachment_link', 'foodland_enhanced_image_navigation', 10, 2 ); /** * Count the number of footer sidebars to enable dynamic classes for the footer * * @since Foodland 0.2 */ function foodland_footer_sidebar_class() { $count = 0; if ( is_active_sidebar( 'footer-1' ) ) $count++; if ( is_active_sidebar( 'footer-2' ) ) $count++; if ( is_active_sidebar( 'footer-3' ) ) $count++; if ( is_active_sidebar( 'footer-4' ) ) $count++; $class = ''; switch ( $count ) { case '1': $class = 'one'; break; case '2': $class = 'two'; break; case '3': $class = 'three'; break; case '4': $class = 'four'; break; } if ( $class ) echo 'class="' . esc_attr( $class ) . '"'; } if ( ! function_exists( 'foodland_body_classes' ) ) : /** * Adds foodland layout classes to the array of body classes. * * @since Foodland 0.2 */ function foodland_body_classes( $classes ) { global $post, $wp_query; //Getting Ready to load data from Theme Options Panel $options = foodland_get_theme_options(); // Check logo if( 4.5 <= (float) get_bloginfo( 'version' ) ){ has_custom_logo() ? $disable_logo = false : $disable_logo = true; } else{ $site_logo = $options['logo']; !empty( $site_logo ) ? $disable_logo = false : $disable_logo = true; } // Adds a class of group-blog to blogs with more than 1 published author if ( is_multi_author() ) { $classes[] = 'group-blog'; } if( false == display_header_text() && $disable_logo ){ $classes[] = ' no_logo_and_title'; } if( ( '' != get_bloginfo( 'name' ) || '' != get_bloginfo( 'description' ) )){ $classes[] = ' has_title'; } if (! $disable_logo ){ $classes [] = ' has_only_logo' ; } $classes = apply_filters( 'foodland_body_classes', $classes ); return $classes; } endif; //foodland_body_classes add_filter( 'body_class', 'foodland_body_classes' ); if ( ! function_exists( 'foodland_post_classes' ) ) : /** * Adds foodland post classes to the array of post classes. * used for supporting different content layouts * * @since Foodland 0.2 */ function foodland_post_classes( $classes ) { //Getting Ready to load data from Theme Options Panel $options = foodland_get_theme_options(); $contentlayout = 'excerpt-image-left clear'; if ( is_archive() || is_home() || is_search() || is_front_page() ) { $classes[] = $contentlayout; } return $classes; } endif; //foodland_post_classes add_filter( 'post_class', 'foodland_post_classes' ); if ( ! function_exists( 'foodland_archive_content_image' ) ) : /** * Template for Featured Image in Archive Content * * To override this in a child theme * simply create your own foodland_archive_content_image(), and that function will be used instead. * * @since Foodland 0.2 */ function foodland_archive_content_image() { if ( has_post_thumbnail() ) { ?>
    get_queried_object_id(); // Getting data from Theme Options $options = foodland_get_theme_options(); if( has_post_thumbnail() ){ ?> '; } endif; //foodland_single_content_image add_action( 'foodland_before_post_container', 'foodland_single_content_image', 10 ); add_action( 'foodland_before_page_container', 'foodland_single_content_image', 10 ); if ( ! function_exists( 'foodland_get_comment_section' ) ) : /** * Comment Section * * @get comment setting from theme options and display comments sections accordingly * @display comments_template * @action foodland_comment_section * * @since Foodland 0.2 */ function foodland_get_comment_section() { if( is_page() || is_single() ) if ( comments_open() || '0' != get_comments_number() ) comments_template(); } endif; add_action( 'foodland_comment_section', 'foodland_get_comment_section', 10 ); /** * Footer Text * * @get footer text from theme options and display them accordingly * @display footer_text * @action foodland_footer * * @since Foodland 0.2 */ function foodland_footer_content() { //foodland_flush_transients(); if ( ( !$foodland_footer_content = get_transient( 'foodland_footer_content' ) ) ) { echo ''; // get the data value from theme options $options = foodland_get_theme_options(); $defaults = foodland_get_default_theme_options(); $footer_content = __( 'Copyright © All Rights Reserved', 'foodland' ); $replace = array( date( 'Y' ), ''. esc_attr( get_bloginfo( 'name', 'display' ) ) . '' ); $disable_social_icon = $options['disable_social_icon']; $social_media_icon = foodland_get_social_icons(); if ( !empty( $footer_content ) || !empty( $social_media_icon ) ) { $foodland_footer_content .= '
    '; set_transient( 'foodland_footer_content', $foodland_footer_content, 86940 ); } } echo $foodland_footer_content; } add_action( 'foodland_footer', 'foodland_footer_content', 100 ); if ( ! function_exists( 'foodland_page_post_meta' ) ) : /** * Post/Page Meta for Google Structure Data */ function foodland_page_post_meta() { $foodland_author_url = esc_url( get_author_posts_url( get_the_author_meta( "ID" ) ) ); $foodland_page_post_meta = '' . __( 'Posted on', 'foodland' ) . ' '; $foodland_page_post_meta .= '' . __( 'By', 'foodland' ) . ' '; return $foodland_page_post_meta; } endif; //foodland_page_post_meta if ( ! function_exists( 'foodland_truncate_phrase' ) ) : /** * Return a phrase shortened in length to a maximum number of characters. * * Result will be truncated at the last white space in the original string. In this function the word separator is a * single space. Other white space characters (like newlines and tabs) are ignored. * * If the first `$max_characters` of the string does not contain a space character, an empty string will be returned. * * @since 1.5 * * @param string $text A string to be shortened. * @param integer $max_characters The maximum number of characters to return. * * @return string Truncated string */ function foodland_truncate_phrase( $text, $max_characters ) { $text = trim( $text ); if ( mb_strlen( $text ) > $max_characters ) { //* Truncate $text to $max_characters + 1 $text = mb_substr( $text, 0, $max_characters + 1 ); //* Truncate to the last space in the truncated string $text = trim( mb_substr( $text, 0, mb_strrpos( $text, ' ' ) ) ); } return $text; } endif; //foodland_truncate_phrase if ( ! function_exists( 'foodland_get_the_content_limit' ) ) : /** * Return content stripped down and limited content. * * Strips out tags and shortcodes, limits the output to `$max_char` characters, and appends an ellipsis and more link to the end. * * @since 0.1 * * @param integer $max_characters The maximum number of characters to return. * @param string $more_link_text Optional. Text of the more link. Default is "(more...)". * @param bool $stripteaser Optional. Strip teaser content before the more text. Default is false. * * @return string Limited content. */ function foodland_get_the_content_limit( $max_characters, $more_link_text = '(more...)', $stripteaser = false ) { $content = get_the_content( '', $stripteaser ); //* Strip tags and shortcodes so the content truncation count is done correctly $content = wp_kses_post( strip_shortcodes( $content ), apply_filters( 'get_the_content_limit_allowedtags', '