calling cimy extra fields in php widget – post author instead of user ID?
-
Word Press Version 3.0
Cimy Extra Fields Version 2.0.4
Executable PHP widget Version 2.1Hello, this is my first time building a php script and I am stoked I have figured it out this far. However, I am trying to go a little further with it. I am sure this is easy for some of you php gurus out there.
Below you will see the code I am displaying in an Executable PHP widget. While I am not sure it is precise as it could be, it does seem work. The only problem is I would have to make a separate widget for each author on my site.
GOAL: To display this widget on specific posts/pages but have it only call the author of the page it is shown on.
QUESTION: Instead of specifying the user id, How can I better write this script so that it uses the post/pages author of the page it is shown on?
<?php $user_ID = 2; $ws = get_cimyFieldValue( $user_ID , WEBSITE1); $fb = get_cimyFieldValue( $user_ID , FACEBOOK); $ms = get_cimyFieldValue( $user_ID , MYSPACE); $tt = get_cimyFieldValue( $user_ID , TWITTER); $sc = get_cimyFieldValue( $user_ID , SOUNDCLOUD); ?> <h3><a href="<?php echo $ws; ?>" target="_blank"><?php the_author() ?>'s Website</a></h3> <h3><a href="<?php echo $fb; ?>" target="_blank"><?php the_author() ?>'s Facebook</a></h3> <h3><a href="<?php echo $ms; ?>" target="_blank"><?php the_author() ?>'s Myspace</a></h3> <h3><a href="<?php echo $tt; ?>" target="_blank"><?php the_author() ?>'s Twitter</a></h3> <h3><a href="<?php echo $sc; ?>" target="_blank"><?php the_author() ?>'s Soundcloud</a></h3>
- The topic ‘calling cimy extra fields in php widget – post author instead of user ID?’ is closed to new replies.