Site logo

Archived topic

RSS Feed issue

7 replies · Started by epickenyan on March 9, 2019

Viewing posts 1–8 of 8

Hi. I am not sure what is causing this issue with the RSS since I switched to generatepress. The post title is showing next to read more (or view more in my case) button and they are close together while it should not http://prntscr.com/mvnl9i.

It did not work. Even tried increasing priority to 99 and purging cache. The code is active if you want to look at the site.

Strange, I've confirmed that it fixes the issue before.

How are you adding the code?

Using the code snippets plugin.

Can you try this instead?:

add_action( 'wp', function() {
    add_filter( 'generate_excerpt_more_output', function( $more ) {
        if ( is_feed() ) {
            return sprintf( ' ... <a title="%1$s" class="read-more" href="%2$s">%3$s</a>',
                the_title_attribute( 'echo=0' ),
                esc_url( get_permalink( get_the_ID() ) ),
                __( 'Read more', 'generatepress' )
            );
        }

        return $more;
    }, 50 );

    add_filter( 'the_content_more_link', function( $more ) {
        if ( is_feed() ) {
            return sprintf( '<p class="read-more-container"><a title="%1$s" class="read-more content-read-more" href="%2$s">%3$s</a></p>',
                the_title_attribute( 'echo=0' ),
                esc_url( get_permalink( get_the_ID() ) . apply_filters( 'generate_more_jump','#more-' . get_the_ID() ) ),
                __( 'Read more', 'generatepress' )
            );
        }

        return $more;
    }, 50 );
}, 100 );

Thanks. The previous option is working. Not sure why it took some time to work. Is this second code more efficient than the first?

No, the first is better if it's working :)

This archived topic is closed to new replies.