WordPress.org

Ready to get started?Download WordPress

Forums

How to hide titles when side is private? (5 posts)

  1. pixipark
    Member
    Posted 4 years ago #

    hi there,

    i'm playing with a side where the main content is private. only a page showing a message and the login form in the sidebar should be visible. when logged in (and only then), a "Recent Articles" is showing and all is fine… until i add either an "Archive" or "Calendar" to the sidebar. Then they also show up when i'm logged out. The "Archive" only with their title but the "Calendar" completely incl. marked day when posts exist.

    question:
    how can i change the behaviour of all items placed in the sidebar that they only show up when i'm logged in?

    any hints are greatly appreciated.

    pixipark

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    Try surrounding the sidebar content with <?php if(is_user_logged_in() ) : ?> [... ] <>php endif;?>

  3. pixipark
    Member
    Posted 4 years ago #

    hi esmi,
    your hint works fine… if i have no dynamic sidebar/widgets.
    i use the "WP-Members" plugin to allow access but this is activated via a widget. and in the moment i have at least one widget the standard in the sidebar.php gets overwritten by the system.
    how and where can i change this?
    tia
    pixipark

  4. pixipark
    Member
    Posted 4 years ago #

    Anyone?

  5. pixipark
    Member
    Posted 4 years ago #

    anyone??

Topic Closed

This topic has been closed to new replies.

About this Topic