Skip to content

Instantly share code, notes, and snippets.

@axeldevo
Created April 1, 2014 16:32
Show Gist options
  • Save axeldevo/9917787 to your computer and use it in GitHub Desktop.
Save axeldevo/9917787 to your computer and use it in GitHub Desktop.
Current user's main title / multisite installation
<?php
switch_to_blog(1);
wp_start_object_cache();
global $current_user;
get_currentuserinfo();
$user = pods(‘user’, $current_user->ID);
echo '<p>' . $user->field(‘user_main’) . '</p>';
restore_current_blog();
wp_start_object_cache();
?>
@axeldevo
Copy link
Author

axeldevo commented Apr 2, 2014

Here's how I fixed it - first define $title:
$title = $user->get_field('user_main');
Then echo works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment