This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//get the value for the relationship field | |
$related = $obj->field( 'company_staff' ); | |
//loop through related field, creating links to their own pages | |
//only if there is anything to loop through | |
if ( ! empty( $related ) && is_array($related) ) { | |
$output = array(); | |
foreach ( $related as $rel ) { | |
//get id for related user and put in id | |
//get name for related user and put in name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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(); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//get the value for the relationship field | |
$related = $obj->field( 'company_investors' ); | |
//loop through related field, creating links to their own pages | |
//only if there is anything to loop through | |
if ( ! empty( $related ) && is_array($related) ) { | |
$output = array(); | |
foreach ( $related as $rel ) { | |
//get id for related investor and put in id | |
//get name for related investor and put in name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$params = array( | |
'where' => "investor_companies.ID = " . get_the_ID(), | |
'limit' => -1 // Return all rows | |
); | |
$investors = pods( 'investor', $params ); | |
if ( 0 < $investors->total() ) { | |
while ( $investors->fetch() ) { | |
$elements[] = '<a href="' . $investors->display( 'permalink' ) . '">' . $investors->display( 'investor_name' ) .'</a>'; | |
} echo implode(', ', $elements);} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//get the value for the relationship field | |
$related = $obj->field( 'company_investors' ); | |
//loop through related field, creating links to their own pages | |
//only if there is anything to loop through | |
if ( ! empty( $related ) ) { | |
foreach ( $related as $rel ) { | |
//get id for related post and put in ID | |
//for advanced content types use $id = $rel[ 'id' ]; | |
$id = $rel[ 'ID' ]; |