• Resolved kenzodailright

    (@kenzodailright)


    hi, I would like to exclude the rss feeds of my site from the forced login. I saw that it can be done via a Hook in the code of the child theme but unfortunately I see that it can only be done by having an “ID” (which wordpress rss feeds don’t have, that I know of). How can I go about solving?

    EDIT:
    I looked for this Hook on the documentation:

    function loginpress_exclude_forcelogin_callback() {
    return array( ‘privacy-policy’, ‘1’ ); //Here ‘1’ is the ID of the post.
    }
    add_filter(‘loginpress_exclude_forcelogin’, ‘loginpress_exclude_forcelogin_callback’ );

    But it needs an ID and a Slug that feed rss don’t have.. How can i solve?

Viewing 1 replies (of 1 total)
  • Plugin Contributor Abdul Wahab

    (@abdulwahab610)

    Hey, @kenzodailright

    The RSS Feed can be excluded from the “Force Login” of LoginPress.
    There is a misunderstanding here, the filter accepts both slug or an ID of the page.
    Since RSS Feed doesn’t have an ID, however, it would have a slug which you can use to exclude here.

    Here is the custom snippet which I have created for you.

    /**
     * Exclude page or posts LoginPress Force Login.
     *
     * @return array $exclude_ids Exclude ID or slug of pages or posts which you want to exclude.
     */
    function loginpress_exclude_forcelogin_callback() {
    	return array( 'feed' );
    }
    add_filter( 'loginpress_exclude_forcelogin', 'loginpress_exclude_forcelogin_callback' );

    However, this is the LoginPress support forum for Premium users. Feel free to contact us with any queries.

    Thank you.

Viewing 1 replies (of 1 total)
  • The topic ‘How to exclude a list of link (feed rss) from force login’ is closed to new replies.