Forums

Join
bbPress Support ForumsInstallationIF User is logged in DO, if not DO...

Info

IF User is logged in DO, if not DO...

  1. 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.

  2. Try

    <?php if (is_user_logged_in()) {
    ?>
    HTML
    <?php } ?>
  3. and if user is not logged in

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

  4. 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"

  5. 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() ?>

  6. I am getting

    'Fatal error: Call to undefined function is_user_logged_in() in C:\wamp\www\massbase\my-templates\massbase\header.php on line 45'

    same thing as Markus Pezold...

    I am using the 1.0 relsease..

    please help thanks.

  7. Hi massbase,

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

  8. 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.

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

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

  11. <?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!

  12. You must log in to post.