php - Advanced Custom Fields - Adding Linkedin -


i having trouble creating clickable linkedin link in wordpress via advanced custom fields plugin. simple when wanted add phone number , email. can not figure out how make linkedin icon appear each user clickable link.

code: function member_contact() {

$vcard = get_field('vcard'); $bio   = get_field('bio_pdf'); $linkedin = get_field('linkedin'); $phone = get_field('phone'); $fax   = get_field('fax'); $email = get_field('email');  $post_info = '';  if (isset($vcard['url'])) {     $img = get_stylesheet_directory_uri() . "/images/mail-icon.png";     $post_info .= '<a class="vcard" href="'.$vcard['url'].'"><img src="'.$img.'" /> download contact</a>'; }  if (isset($bio['url']) && isset($vcard['url'])) {     $post_info .= ' | '; }  if (isset($bio['url'])) {     $post_info .= '<a class="bio-pdf" href="'.$bio['url'].'">download bio</a>'; }  if (isset($linkedin['url']) && isset($vcard['url']) || isset($bio['url'])) {     $post_info .= ' | '; }  if (isset($linkedin['url'])) {     $post_info .= '<a href="'.$linkedin['url'].'"><i class="fa fa-linkedin" style="color:blue"></i> linkedin</a>'; }   $post_info .= '<ul class="member-contact">'; $post_info .= "<li>$email</li>"; $post_info .= "<li>p: $phone</li>"; $post_info .= "<li>f: $fax</li>"; $post_info .= "</ul>"; var_dump($linkedin); 

code user's repo (kevinlearynet),which not sure how integrate

                <?php if ( $linkedin = get_field('team_linkedin') ): ?>                 <a href="<?php echo $linkedin; ?>"><i class="icon-linkedin"></i></a>                 <?php endif; ?> 

dump $linkedin

string(21) "https://www.yahoo.com" 

pictures: enter image description here

you can edit code integrate linkedin link.

function member_contact() {          $vcard = get_field('vcard');         $bio   = get_field('bio_pdf');         $phone = get_field('phone');         $fax   = get_field('fax');         $linkedin = get_field('linkedin');         $email = get_field('email');          $post_info = '';          if (isset($vcard['url'])) {             $img = get_stylesheet_directory_uri() . "/images/mail-icon.png";             $post_info .= '<a class="vcard" href="'.$vcard['url'].'"><img src="'.$img.'" /> download contact</a>';         }          if (isset($bio['url']) && isset($vcard['url'])) {             $post_info .= ' | ';         }          if (isset($bio['url'])) {             $post_info .= '<a class="bio-pdf" href="'.$bio['url'].'">download bio</a>';         }          $post_info .= '<ul class="member-contact">';         $post_info .= "<li>$email</li>";         $post_info .= "<li>p: $phone</li>";         $post_info .= '<a href="$linkedin"><i class="icon-linkedin"></i></a>';         $post_info .= "<li>f: $fax</li>";         $post_info .= "</ul>";          genesis_markup( array(             'html5' => sprintf( '<div class="entry-meta">%s</div>', $post_info ),             'xhtml' => sprintf( '<div class="post-info">%s</div>', $post_info ),         ) );      } 

Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -