/** * Return the post content, either excerpted or in full length * @param string $page_id The id of the current page or post * @param string $excerpt Can be either 'blog' (for main blog page), 'portfolio' (for portfolio page template) or 'yes' (for shortcodes) * @param integer $excerpt_length Length of the excerpts * @param boolean $strip_html Can be used by shortcodes for a custom strip html setting * * @return string Post content **/ function fusion_get_post_content($page_id = '', $excerpt = 'blog', $excerpt_length = 55, $strip_html = FALSE) { global $smof_data; $content_excerpted = FALSE; // Main blog page if ($excerpt == 'blog') { // Check if the content should be excerpted if (strtolower(fusion_get_theme_option('content_length')) == 'excerpt') { $content_excerpted = TRUE; // Get the excerpt length $excerpt_length = fusion_get_theme_option('excerpt_length_blog'); } // Check if HTML should be stripped from contant if (fusion_get_theme_option('strip_html_excerpt')) { $strip_html = TRUE; } // Portfolio page templates } elseif ($excerpt == 'portfolio') { // Check if the content should be excerpted if (fusion_get_option('portfolio_content_length', 'portfolio_content_length', $page_id) == 'excerpt') { $content_excerpted = TRUE; // Determine the correct excerpt length if (fusion_get_page_option('portfolio_excerpt', $page_id)) { $excerpt_length = fusion_get_page_option('portfolio_excerpt', $page_id); } else { $excerpt_length = fusion_get_theme_option('excerpt_length_portfolio'); } } // Check if HTML should be stripped from contant if (fusion_get_theme_option('portfolio_strip_html_excerpt')) { $strip_html = TRUE; } // Shortcodes } elseif ($excerpt == 'yes') { $content_excerpted = TRUE; } // Return excerpted content if ($content_excerpted) { $stripped_content = fusion_get_post_content_excerpt($excerpt_length, $strip_html); return $stripped_content; // Return full content } else { ob_start(); the_content(); return ob_get_clean(); } }
/** * Return the post content, either excerpted or in full length * @param string $page_id The id of the current page or post * @param string $excerpt Can be either 'blog' (for main blog page), 'portfolio' (for portfolio page template) or 'yes' (for shortcodes) * @param integer $excerpt_length Length of the excerpts * @param boolean $strip_html Can be used by shortcodes for a custom strip html setting * * @return string Post content **/ function fusion_get_post_content($page_id = '', $excerpt = 'blog', $excerpt_length = 55, $strip_html = FALSE) { $content_excerpted = FALSE; // Main blog page if ($excerpt == 'blog') { // Check if the content should be excerpted if (strtolower(fusion_get_theme_option('content_length')) == 'excerpt') { $content_excerpted = TRUE; // Get the excerpt length $excerpt_length = fusion_get_theme_option('excerpt_length_blog'); } // Check if HTML should be stripped from contant if (fusion_get_theme_option('strip_html_excerpt')) { $strip_html = TRUE; } // Portfolio page templates } elseif ($excerpt == 'portfolio') { // Check if the content should be excerpted if (fusion_get_option('portfolio_content_length', 'portfolio_content_length', $page_id) == 'excerpt') { $content_excerpted = TRUE; // Determine the correct excerpt length if (fusion_get_page_option('portfolio_excerpt', $page_id)) { $excerpt_length = fusion_get_page_option('portfolio_excerpt', $page_id); } else { $excerpt_length = fusion_get_theme_option('excerpt_length_portfolio'); } } else { if (!$page_id && fusion_get_theme_option('portfolio_content_length') == 'Excerpt') { $content_excerpted = TRUE; $excerpt_length = fusion_get_theme_option('excerpt_length_portfolio'); } } // Check if HTML should be stripped from contant if (fusion_get_theme_option('portfolio_strip_html_excerpt')) { $strip_html = TRUE; } // Shortcodes } elseif ($excerpt == 'yes') { $content_excerpted = TRUE; } // Sermon specific additional content if ('wpfc_sermon' == get_post_type(get_the_ID())) { $sermon_content = ''; $sermon_content .= avada_get_sermon_content(true); return $sermon_content; } // Return excerpted content if ($content_excerpted) { $stripped_content = fusion_get_post_content_excerpt($excerpt_length, $strip_html); return $stripped_content; // Return full content } else { ob_start(); the_content(); return ob_get_clean(); } }
/** * Return the post content, either excerpted or in full length * @param string $page_id The id of the current page or post * @param string $excerpt Can be either 'blog' (for main blog page), 'portfolio' (for portfolio page template) or 'yes' (for shortcodes) * @param integer $excerpt_length Length of the excerpts * @param boolean $strip_html Can be used by shortcodes for a custom strip html setting * * @return string Post content **/ function fusion_get_post_content($page_id = '', $excerpt = 'blog', $excerpt_length = 55, $strip_html = FALSE) { $content_excerpted = FALSE; // Main blog page if ($excerpt == 'blog') { // Check if the content should be excerpted if (strtolower(Avada()->settings->get('content_length')) == 'excerpt') { $content_excerpted = TRUE; // Get the excerpt length $excerpt_length = Avada()->settings->get('excerpt_length_blog'); } // Check if HTML should be stripped from contant if (Avada()->settings->get('strip_html_excerpt')) { $strip_html = TRUE; } // Portfolio page templates } elseif ($excerpt == 'portfolio') { // Check if the content should be excerpted $portfolio_excerpt_length = avada_get_portfolio_excerpt_length($page_id); if ($portfolio_excerpt_length !== false) { $excerpt_length = $portfolio_excerpt_length; $content_excerpted = TRUE; } // Check if HTML should be stripped from contant if (Avada()->settings->get('portfolio_strip_html_excerpt')) { $strip_html = TRUE; } // Shortcodes } elseif ($excerpt == 'yes') { $content_excerpted = TRUE; } // Sermon specific additional content if ('wpfc_sermon' == get_post_type(get_the_ID())) { $sermon_content = ''; $sermon_content .= avada_get_sermon_content(true); return $sermon_content; } // Return excerpted content if ($content_excerpted) { $stripped_content = fusion_get_post_content_excerpt($excerpt_length, $strip_html); return $stripped_content; // Return full content } else { ob_start(); the_content(); return ob_get_clean(); } }