Skip to:
Content
Pages
Categories
Search
Top
Bottom

IF User is logged in DO, if not DO…

  • @massbase

    Member

    is there an if structure to do little if’s around the site, for example im having trouble changing the header of my site, to display certain texts when they’re logged in and when they’re logged out.

Viewing 10 replies - 1 through 10 (of 10 total)
  • @johnjamesjacoby

    Keymaster

    Try

    <?php if (is_user_logged_in()) {
    ?>
    HTML
    <?php } ?>

    @shagalaga

    Member

    and if user is not logged in

    <?php if (!is_user_logged_in()) {

    ?>

    HTML

    <?php } ?>

    @markus-pezold

    Participant

    Hi all,

    is this a function from bbPress 1.0 Release Candidate? In 0.9.0.5 it seems not to work:

    "Fatal error: Call to undefined function is_user_logged_in() in ../forum/bb-templates/scoun/front-page.php on line 3"

    @ohna

    Member

    Hi,all

    I use this for display “add new topic”, try:

    <?php if ( bb_is_user_logged_in() ) : ?>

    HTML

    <?php endif; // bb_is_user_logged_in() ?>

    @massbase

    Member

    I am getting

    ‘Fatal error: Call to undefined function is_user_logged_in() in C:wampwwwmassbasemy-templatesmassbaseheader.php on line 45’

    same thing as Markus Pezold…

    I am using the 1.0 relsease..

    please help thanks.

    @markus-pezold

    Participant

    Hi massbase,

    the code from Ohna “(bb_is_user_logged_in())” works perfect in my installation. No more problems with that.

    @massbase

    Member

    wooohooo, thanks Ohna, and thanks Markus for pointing out Ohnas post was different to James’s

    I plan to release my theme to the general public and boy, its looking awesome.

    @johnjamesjacoby

    Keymaster

    Whoops… Need to remember to switch out of WordPress support mode! Totally my fault.

    @massbase

    Member

    @jjj good thing you left in the 0.9 code in, the forum needs more detailed function support. cheers.

    @shagalaga

    Member

    <?php if ( !bb_is_user_logged_in() ) : ?>

    HTML

    <?php endif; // bb_is_user_logged_in() ?>

    this very good to add extra information or Ads for people who are not logged in ;-)

    Yes it works!

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.
Skip to toolbar