Support

Account

Home Forums General Issues Pull in fields from page with same name as username Reply To: Pull in fields from page with same name as username

  • Hi Nuro, that’s a no on that but thank you for your suggestion.

    It’s crazy. It seems so easy yet just doesn’t work.

    Trying it normally with manual ID of page like:

    <?php
    $other_page = 890;
    ?>
    <?php the_field('field_name', $other_page); ?>

    …works great so the data IS being passed from the other page. I then had another idea of trying this way:

    <?php
    global $current_user;
    get_currentuserinfo();
    $username = $current_user->user_login;
    $other_page = $username;				
    ?>
    <p><?php the_field('favourite_movie', $other_page); ?></p>

    …which didn’t work either.

    The username of the current user IS also working when I ask for it conventionally:

    <?php global $current_user;
          get_currentuserinfo();
          echo 'Username is ' . $current_user->user_login . "\n";
    ?>

    Baffled.

    Elliot, how can I debug this? I’ve tried dumping the values:

    <?php
    global $current_user;
    get_currentuserinfo();
    
    $other_page = $current_user->user_login;
    $values = get_field('favourite_movie');
    var_dump($values);
    ?>

    and get bool(false) printed out?