'list_header_hide', 'list_title_display' => 'list_title_hide', 'list_author_display' => 'list_author_hide', 'list_date_display' => 'list_date_hide', 'list_category_display' => 'list_category_hide', 'list_thumbnail_display' => 'list_thumbnail_hide', 'list_summary_display' => 'list_summary_hide', 'list_footer_display' => 'list_footer_hide', 'list_tags_display' => 'list_tags_hide', 'list_button_comment_display' => 'list_button_comment_hide', 'list_button_edit_display' => 'list_button_edit_hide', ); foreach ( $options_list as $option => $class ) { $value = get_post_meta( $post_id, 'pen_' . $option . '_override', true ); if ( $value && 'default' !== $value ) { $classes[] = 'pen_' . $class; } } $animation_reveal = get_post_meta( $post_id, 'pen_list_animation_reveal_override', true ); if ( ! $animation_reveal || 'default' === $animation_reveal ) { $animation_reveal = pen_option_get( 'list_animation_reveal' ); } if ( $animation_reveal ) { $classes[] = 'pen_custom_animation_' . $animation_reveal; } $header_alignment = get_post_meta( $post_id, 'pen_list_post_header_alignment_override', true ); if ( ! $header_alignment || 'default' === $header_alignment ) { $header_alignment = pen_option_get( 'list_post_header_alignment' ); } if ( $header_alignment && 'no' !== $header_alignment ) { $classes[] = 'pen_list_header_center'; } $title_alignment = get_post_meta( $post_id, 'pen_list_title_alignment_override', true ); if ( ! $title_alignment || 'default' === $title_alignment ) { $title_alignment = pen_option_get( 'list_title_alignment' ); } if ( $title_alignment && 'no' !== $title_alignment ) { $classes[] = 'pen_list_title_center'; } $thumbnail_style = get_post_meta( $post_id, 'pen_list_masonry_thumbnail_style_override', true ); if ( false === $thumbnail_style || empty( $thumbnail_style ) || 'default' === $thumbnail_style ) { $thumbnail_style = pen_option_get( 'list_masonry_thumbnail_style' ); } $classes[] = 'pen_thumbnail_style_' . $thumbnail_style; } return post_class( $classes ); } } if ( ! function_exists( 'pen_post_excerpt' ) && ! is_admin() ) { /** * Tweaks the automatically generated post excerpt. * * @param string $more Default 'more' string. * * @since Pen 1.0.0 * @return string */ function pen_post_excerpt( $more ) { $link = sprintf( '%2$s', esc_url( get_permalink( get_the_ID() ) ), sprintf( /* Translators: %s: Name of current post */ __( 'Continue reading %s', 'pen' ), sprintf( '%1$s', get_the_title( get_the_ID() ) ) ) ); return ' …' . $link; } add_filter( 'excerpt_more', 'pen_post_excerpt' ); } if ( ! function_exists( 'pen_post_sticky' ) ) { /** * Sends sticky posts to the top of the lists. * * @param WP_Posts $posts An instance of WP_Post. * * @since Pen 1.0.0 */ function pen_post_sticky( $posts ) { $is_sticky = array(); foreach ( $posts as $key => $post ) { if ( is_sticky( $post->ID ) ) { $is_sticky[] = $post; unset( $posts[ $key ] ); } } return array_merge( $is_sticky, $posts ); } add_filter( 'the_posts', 'pen_post_sticky' ); } if ( ! function_exists( 'pen_post_meta' ) ) { /** * Custom post meta data fields. * * @param object $post An instance of the $post. * * @since Pen 1.0.0 * @return void */ function pen_post_meta( $post ) { $post_type = get_post_type(); ob_start( 'pen_compress_html' ); ?>