• Resolved Vimal Roy

    (@vimalroy08)


    Hi,

    Can we create different feed pages for different clients? We need to restrict the content length for some clients, and we need to show full content for others. Is that possible? Can we customize the feed page for this functionality? Also, we don’t want to remove the HTML elements from the content.

    The code that we are planning to use for limiting the content of each post feed is mentioned below.

    function custom_content_length_feed( $content ) {
    
        if ( ! is_feed() )
            return $content;
        $words = 200;
        $more = '…';
        $content = substr( $content, $words, $more );
        $content = force_balance_tags( $content );
        return $content;
    }
    add_filter( 'the_content_feed', 'custom_content_length_feed' );

    Any ideas?

    • This topic was modified 1 year, 9 months ago by Vimal Roy.

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

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    You could check $_SERVER['HTTP_REFERER'] and/or $_SERVER['HTTP_USER_AGENT'] to determine what client app or IP made the feed request and conditionally do one thing or another based on it.

    Filters are one way to customize feeds, but you can even redefine the entire template if you needed to. More on Customizing Feeds is available in the Codex.

Viewing 1 replies (of 1 total)
  • The topic ‘Can we create different feed pages for different clients?’ is closed to new replies.