Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="PortfolioUpper">
- <?php
- // ref link: http://wordpress.org/support/topic/access-author-data-outside-loop-in-sidebar
- // ref link: http://wordpress.org/support/topic/custom-singlephp-for-specific-author
- // ref link: http://codex.wordpress.org/Function_Reference/get_the_author_meta
- // ref link: http://codex.wordpress.org/Function_Reference/get_the_category
- // ref link: http://codex.wordpress.org/Function_Reference/get_the_category#Get_the_Post_Categories_From_Outside_the_Loop
- // ref link: http://wordpress.org/support/topic/get-tags-outside-the-loop
- genesis_structural_wrap( 'sidebar' );
- global $post;
- $thePostID = $posts[0]->ID;
- $thePostCat = get_the_category($thePostID);
- $posttags = get_the_tags($thePostID);
- $authorID = $posts[0]->post_author;
- $artist = get_the_author_meta('display_name',$authorID);
- $artistWebSite = get_the_author_meta('url',$authorID);
- $artistWebSite2 = get_the_author_meta('website2',$authorID);
- $artistBio = get_the_author_meta('description',$authorID);
- $artistBioWYSIWYG = get_the_author_meta('intro_text',$authorID);
- $artistPhone = get_the_author_meta('business_phone',$authorID);
- $artistCompany = get_the_author_meta('business_name',$authorID);
- $artistAddress = get_the_author_meta('business_address',$authorID);
- $artistLat = get_the_author_meta('business_latitude',$authorID);
- $artistLong = get_the_author_meta('business_longitude',$authorID);
- $artistTownship = get_the_author_meta('business_township',$authorID);
- $artistGplus = get_the_author_meta('googleplus',$authorID);
- $artistFacebook = get_the_author_meta('facebook',$authorID);
- $artistTwitter = get_the_author_meta('twitter',$authorID);
- $artistPinterest = get_the_author_meta('pinterest',$authorID);
- $artistInstagram = get_the_author_meta('instagram',$authorID);
- $artistYoutube = get_the_author_meta('youtube',$authorID);
- $artistEmail = get_the_author_meta('user_email',$authorID);
- do_action( 'genesis_before_sidebar_widget_area' );
- echo '<div class="widget-wrap">';
- //echo '<p>Author ID: '.$authorID.'</p>';
- //echo '<p>Post ID: '.$thePostID.'</p>';
- //echo '<p>Post Category: '.$thePostCat.'</p>';
- //echo '<p>Post Category Name: '.$thePostCatName.'</p>';
- //echo '<p>see what is what: '.var_dump($thePostCat).'</p>';
- echo '<h4 class="widget-title widgettitle">'.$artist.'</h4>';
- echo 'Category: <a href="'.get_category_link($thePostCat[0]->term_id ).'">'.$thePostCat[0]->cat_name.'</a>';
- if ($posttags) {
- echo '<p>Post Tags: <br>';
- foreach($posttags as $tag) {
- echo '<p><a href="'.get_tag_link($tag->term_id).'">'.$tag->name.'</a></p>';
- }
- }
- echo ( wpautop($artistBio) );
- //echo ( wpautop($artistBioWYSIWYG) );
- echo '<p>'.$artistPhone.'</p>';
- echo '<p><a rel="nofollow" href="'.$artistWebSite.'">'.$artistWebSite.'</a></p>';
- echo '<p><a rel="nofollow" href="'.$artistWebSite2.'">'.$artistWebSite2.'</a></p>';
- echo '<ul id=cpt-connections>';
- if (!empty($artistGplus)) {
- echo '<li class="cpt-googleplus"><a rel="nofollow" href="'.$artistGplus.'">'.$artistGplus.'</a></li>';
- }
- if (!empty($artistFacebook)) {
- echo '<li class="cpt-facebook"><a rel="nofollow" href="'.$artistFacebook.'">'.$artistFacebook.'</a></li>';
- }
- if (!empty($artistTwitter)) {
- echo '<li class="cpt-twitter"><a rel="nofollow" href="'.$artistTwitter.'">'.$artistTwitter.'</a></li>';
- }
- if (!empty($artistPinterest)) {
- echo '<li class="cpt-pinterest"><a rel="nofollow" href="'.$artistPinterest.'">'.$artistPinterest.'</a></li>';
- }
- if (!empty($artistInstagram)) {
- echo '<li class="cpt-instagram"><a rel="nofollow" href="'.$artistInstagram.'">'.$artistInstagram.'</a></li>';
- }
- if (!empty($artistYoutube)) {
- echo '<li class="cpt-youtube"><a rel="nofollow" href="'.$artistYoutube.'">'.$artistYoutube.'</a></li>';
- }
- if (!empty($artistEmail)) {
- echo '<li class="cpt-email"><a href="mailto:'.$artistEmail.'">'.$artistEmail.'</a></li>';
- }
- echo '</ul>';
- echo '<p>'.$artistCompany.'</p>';
- echo '<p>'.$artistTownship.'</p>';
- echo '<p>'.$artistAddress.'</p>';
- echo '</div>';
- do_action( 'genesis_after_sidebar_widget_area' );
- genesis_structural_wrap( 'sidebar', 'close' );
- ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement