[Support request] Hide or show blocks when logged in or logged out?

Home Forums Support [Support request] Hide or show blocks when logged in or logged out?

Home Forums Support Hide or show blocks when logged in or logged out?

  • This topic has 3 replies, 2 voices, and was last updated 5 months ago by Fernando.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2380512
    Martin

    Not sure if this is possible.
    Is it possible to set a GenerateBlocks block to only be visible to logged in users / logged out users?

    Thanks.

    Martin

    #2380580
    Fernando
    Customer Support

    Hi Martin,

    It’s possible, but you’ll need custom code for that.

    If you’re adding the Blocks through a Block Element, it’s possible through the Display rules.

    #2380685
    Martin

    What do you mean “through a block element”?
    I’m adding GenerateBlock containers with grids inside and then my content inside there.

    #2380692
    Fernando
    Customer Support

    If you’re using a Block Element, in the Display Rules, you can set it up so the it appears only to logged in or logged out users. Example: https://share.getcloudapp.com/4gueGnKE

    So, you can create a Block Element and inject the Block you want appearing or disappearing depending if a user is logged in or not.

    If you’re placing it in a specific location in your content which isn’t available through the current hooks, you’ll need to create a portable hook. For this, see my response here: https://generatepress.com/forums/topic/hooks-related-question/#post-2170598

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.