Viewing 1 replies (of 1 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hello!

    What you needed to change was fl_description to prop_description.

    add_filter( 'the_seo_framework_fetched_description_excerpt', function( $excerpt, $depr, $args ) {
    
        if ( null === $args ) {
            // In the loop.
            $get_field = is_singular();
        } else {
            // Out the loop; only $args['id'] may be filled...
            $get_field = $args['id'] && empty( $args['taxonomy'] ) && empty( $args['pta'] );
        }
    
        $field = '';
    
        if ( $get_field ) {
            $field = function_exists( 'get_field' ) ? get_field( 'prop_description', $args['id'] ?? null ) : '';
            $field = $field ? tsf()->s_excerpt_raw( $field ) : '';
        }
    
        return $field ?: $excerpt;
    }, 10, 3 );

    I did that for you in the snippet above ?? Cheers!

    (I also used tsf() instead of the_seo_framework(), available since TSF v4.2+)

Viewing 1 replies (of 1 total)
  • The topic ‘Output Meta Description with Custom Field’ is closed to new replies.