Permalink
Browse files

Agregada nueva función t_em_get_post_excerpt()

Bug Fixed: Mejorada la salida en t_em_slider_bootstrap_carousel()
  • Loading branch information...
rogertm committed Dec 8, 2017
1 parent 16cadac commit 988137a61729d51b180a2f032412af797fe9723c
Showing with 79 additions and 5 deletions.
  1. +43 −0 changelog.txt
  2. +33 −2 inc/functions.php
  3. +2 −2 style.css
  4. +1 −1 templates/header.php
View
@@ -1,27 +1,47 @@
== Changelog ==
= 1.2.2 =
Release Date: December 08, 2017
* Enhancement: New helper function t_em_get_post_excerpt()
* Bug Fix: Fixed broken <p> output in t_em_slider_bootstrap_carousel()
Release Date: November 30, 2017
* Update: Bootstrap v4.0.0-beta.2
* Update: jQuery v3.0.0 to support Bootstrap js plugins
* Delete: /js/html5-shiv.js
= 1.2.1 =
Release Date: October 21, 2017
* Enhancement: Added Yelp to Social Network Options
Release Date: October 12, 2017
* Enhancement: Added the parameter "vertical" in shortcode [btn-group]
* Bug Fix: Removed the <p> jumps in t_em_shortcode_cleanup()
= 1.2 =
Release Date: October 09, 2017
* Enhancement: Better Debug Info Panel
* Enhancement: Support for custom post types in single related posts. Added the "t_em_filter_single_related_post_query" filter
* Enhancement: Added shortcode support in term description t_em_term_description()
= Bootstrap 4 =
Release Date: September 09, 2017
* Enhancement: A fully migration to Bootstrap v4.0.0-beta
* Enhancement: Completely deletion of LESS features in favor of SASS preprocessor
* Enhancement: New and simpler Icomoon icon pack
@@ -56,24 +76,36 @@ Release Date: September 09, 2017
* Delete: T_EM_LAYOUT_WIDTH_MIN_VALUE Constant
* Delete: t_em_archive_cols()
= 1.1.2 =
Release Date: August 01, 2017
* Enhancement: Added T_EM_BLOG, T_EM_WIKI, T_EM_PAYPAL
* Update: Updated right sidebar on help panel
* Bug Fix: Fix some E_NOTICE in widgets
* Bug Fix: Disable comments supports for pages if [single_page_comments] => 1
* Bug Fix: Do not show "Comments are close" if current post type does not support them in .entry-meta.entry-meta-footer
= 1.1.1 =
Release Date: July 10, 2017
* Enhancement: Favicon sizes support
Release Date: July 01, 2017
* Enhancement: Theme Tags compatibles with WordPress.org
* Enhancement: Added 'no-svg' class in <html> tag
* Bug Fix: Added chartset meta tag
Release Date: June 26, 2017
* Bug Fix: t_em_restore_from_scratch() is hooked now in 'wp'
Release Date: June 22, 2017
* Update: Data Base version 20170622
* Enhancement: Added the Filter Hook "t_em_filter_starter_content"
* Enhancement: Added theme support for "starter-content"
@@ -86,7 +118,9 @@ Release Date: June 22, 2017
* Function Removed: t_em_header_style(), t_em_admin_header_style(), t_em_admin_header_image() in favor of Header Image in WordPress Customizer
* Enhancement: t_em_favicon() now checks if there is a site icon before to load the default icon
* Function Removed: "t_em_general_options_favicon()" in favor of Site Icon option in WordPress Customizer
Release Date: June 21, 2017
* Bug Fix: Sanitize text fields in Maintenance Mode Options
* New URL: https://themingisprose.com
* Bug Fix: Added the viewport meta in header area
@@ -95,8 +129,11 @@ Release Date: June 21, 2017
* Enhancement: Upgrade to LESS PHP version 1.7.0.13
* Function Removed: "t_em_heading_site_title()",
= 1.1 =
Release Date: February 02, 2017
* Bug Fix: Fixed Notice in t_em_custom_template_content()
* Enhancement: Upgrade to Bootstrap 3.3.7
* Enhancement: Added the Action Hook "t_em_action_header_image_before"
@@ -115,10 +152,16 @@ Release Date: February 02, 2017
* Enhancement: Added full width option (Layout Panel)
* Enhancement: Added the Maintenance Mode Option
= 1.0.1 =
Release Date: August 07, 2016
* Bug Fix: Minimized all Bootstrap's jquery plugin files
= 1.0 =
Release Date: July 09, 2016
* Initial release
View
@@ -372,9 +372,7 @@ function t_em_image_resize( $width, $height, $post_id = 0, $crop = true ){
/**
* Helper. Wrap paragraphs into <p> ...</p> tags, and clean empty lines
*
* @param string $paragraph Require Paragraph to be wrapped into <p> ...</p> tags
*
* @return string
*
* @since Twenty'em 1.0
@@ -390,4 +388,37 @@ function t_em_wrap_paragraph( $paragraph ){
endwhile;
return implode( "", $clean_paragraph );
}
/**
* Get the resume of every post
* @param int $post_id Post ID. Default 0, the current post
* @param bool $echo Return the value or print it on screen. Default to 'true'
* @return string The 'post_excerpt' field or the first $trim words of the 'post_content' fields
* if 'post_excerpt' is empty
*
* @since Twenty'em 1.2.2
*/
function t_em_get_post_excerpt( $post_id = 0, $echo = true ){
global $t_em, $post;
$post_id = absint( $post_id );
if ( ! $post_id )
$post_id = $post->ID;
$excerpt = get_post_field( 'post_excerpt', $post_id );
$content = get_post_field( 'post_content', $post_id );
$trim = $t_em['excerpt_length'];
if ( ! empty( $excerpt ) ) :
$resume = $excerpt;
else :
$resume = wp_trim_words( $content, $trim );
endif;
if ( $echo ) :
echo strip_shortcodes( $resume );
else :
return strip_shortcodes( $resume );
endif;
}
?>
View
@@ -4,7 +4,7 @@
* Description: A HTML5 and CSS3 WordPress theme/framework for developers. Great for Child Themes creation
* Author: RogerTM
* Author URI: https://themingisprose.com/
* Version: 1.2.1
* Version: 1.2.2
* License: GNU General Public License v2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
* Tags: one-column, two-columns, three-columns, left-sidebar, right-sidebar, flexible-header, custom-background, custom-header, custom-menu, custom-logo, editor-style, featured-image-header, featured-images, footer-widgets, front-page-post-from, full-width-template, post-formats, theme-options, threaded-comments, translation-ready, blog, news, portfolio
@@ -13,7 +13,7 @@
/**
* Just that!
* This file is for identify the theme in WordPress
* The compiled css files and the scss sources are located at css/ directory
* The compiled css files and the scss sources are located at css/ and scss/ directories respectively
* Bootstrap source files are located at bootstrap/ directory
* Happy Theming!
*/
View
@@ -148,7 +148,7 @@ function t_em_slider_bootstrap_carousel( $args ){
<h3 class="item-title">
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 't_em' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php echo get_the_title(); ?></a>
</h3>
<p class="item-summary d-none d-md-block"><?php echo get_the_excerpt(); ?></p>
<p class="item-summary d-none d-md-block"><?php echo t_em_get_post_excerpt(); ?></p>
</div>
</div><!-- .item -->
<?php endforeach; wp_reset_postdata(); ?>

0 comments on commit 988137a

Please sign in to comment.