Support » Plugin: Newsletter » Custom field instead of the_excerpt

  • Resolved keengamer

    (@keengamer)


    Hello,

    our theme is using a different text to show instead of the default excerpt. We need to show it also in the emails instead of the text taken from the beginning of the article. How can we do it? We tried to change the code slightly but without any luck. We can change probably module.php if you tell us precisely what to use.

    We bought the plugin today but without this option it’s useless for us and we will need to request a refund…

    Here is a sample of what we have in our functions.php to show you what to use:

    /**
    * Custom excerpt format
    *
    */
    if ( ! function_exists( ‘ghostpool_excerpt’ ) ) {
    function ghostpool_excerpt( $length, $read_more_link = ‘disabled’ ) {

    if ( $read_more_link == ‘enabled’ ) {
    $more_text = ‘…‘ . esc_html__( ‘[Read More]’, ‘huber’ ) . ‘‘;
    } else {
    $more_text = ‘…’;
    }

    if ( get_post_meta( get_the_ID(), ‘synopsis’, true ) ) {
    $excerpt = get_post_meta( get_the_ID(), ‘synopsis’, true );
    } elseif ( get_post_meta( get_the_ID(), ‘video_description’, true ) ) {
    $excerpt = get_post_meta( get_the_ID(), ‘video_description’, true );
    } else {
    $excerpt = get_post_meta( get_the_ID(), ‘subtitle’, true ) . ‘ ‘ . get_the_excerpt();
    }

    $excerpt = strip_tags( $excerpt );
    if ( function_exists( ‘mb_strlen’ ) && function_exists( ‘mb_substr’ ) ) {
    if ( mb_strlen( $excerpt ) > $length ) {
    $excerpt = mb_substr( $excerpt, 0, $length ) . $more_text;
    }
    } else {
    if ( strlen( $excerpt ) > $length ) {
    $excerpt = substr( $excerpt, 0, $length ) . $more_text;
    }
    }
    return $excerpt;
    }
    }

    Thank you.

    K.

    • This topic was modified 2 months, 2 weeks ago by keengamer.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.