• Resolved talentoracle

    (@talentoracle)


    Greetings, Nooz is a great product! I have the date settings set at M j, Y and wanted to see if there is a way that Nooz can automatically add a space or 2 between the date function and the beginning of the post. For example, the present format looks like this: RTP, NC—January 31, 2018Hunt Scanlon Media and I’d like a space or 2 between 2018 and Hunt Scanlon in this example so it doesn’t run together.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor farinspace

    (@farinspace)

    Hi @talentoracle,

    The run-together of the location/date and excerpt in the list of press release posts is a bug. Our latest version fixes this issue, however it is currently NOT released publicly yet.

    Below I have provided the immediate fix. You will have to add the following to your functions.php file:

    add_filter( 'get_the_excerpt', 'my_nooz_press_release_excerpt', 10, 2 );
    function my_nooz_press_release_excerpt( $output, $post ) {
        if ( 'nooz_release' == $post->post_type ) {
            $length = apply_filters( 'excerpt_length', 55 );
            $ending = apply_filters( 'excerpt_more', ' ' . '[…]' );
            $output = ! empty( $post->post_excerpt ) ? $post->post_excerpt : wp_trim_words( $post->post_content, $length, $ending );
        }
        return $output;
    }
    

    Additionally add the following if you would also like to have the location/date in the excerpts.

    add_filter( 'get_the_excerpt', 'my_nooz_press_release_excerpt_with_location_and_date', 10, 2 );
    function my_nooz_press_release_excerpt_with_location_and_date( $output, $post ) {
        if ( 'nooz_release' == $post->post_type ) {
            $location = get_option( 'mdnooz_release_location' );
            $date_format = get_option( 'mdnooz_release_date_format' ) ? wp_kses_data( strip_tags( get_option( 'mdnooz_release_date_format' ) ) ) : get_option( 'date_format' );
            $date = get_the_date( $date_format );
            $output = $location . '—' . $date . ' ' . $output;
        }
        return $output;
    }
    
    • This reply was modified 5 years, 11 months ago by farinspace. Reason: text edits
    Thread Starter talentoracle

    (@talentoracle)

    Thank you @farinspace

    • This reply was modified 5 years, 11 months ago by talentoracle.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding a space after a press release date’ is closed to new replies.