How to Show Url and Twitter fields in the Single Speaker Page

  1. Home
  2. Docs
  3. Event Manager
  4. Frequently Asked Question...
  5. How to Show Url and Twitter fields in the Single Speaker Page

How to Show Url and Twitter fields in the Single Speaker Page

1. Backup the original files before making any changes.

2. Open the file wp-content/themes/event-manager/single-sc-speakers.php

3. Look for the line: 

echo ‘<p>’ . get_the_post_thumbnail( $post->ID, ‘sc_thumbnail’ ) . ‘</p>’;

4. Below that add the following code: 

$url = esc_url( get_post_meta( $post->ID, ‘sc_speaker_url’, true ) ); 
if( !empty( $url ) ) echo ‘<h4><a href=”‘ . $url . ‘” target=”_blank”>’ . $url . ‘</a></h4>’; 
$twitter = esc_attr( get_post_meta( $post->ID, ‘sc_speaker_twitter’, true ) ); 
if( !empty( $twitter ) ) echo ‘<p><a href=”http://www.twitter.com/’; . $twitter . ‘” target=”_blank”>@’ . $twitter . ‘</a>

5. Your new code should now look like: 

function sc_speaker_single_image() { 
global $post; 
if( has_post_thumbnail() ) 
echo ‘<p>’ . get_the_post_thumbnail( $post->ID, ‘sc_thumbnail’ ) . ‘</p>’; 
$url = esc_url( get_post_meta( $post->ID, ‘sc_speaker_url’, true ) ); 
if( !empty( $url ) ) echo ‘<h4><a href=”‘ . $url . ‘” target=”_blank”>’ . $url . ‘</a></h4>’; 
$twitter = esc_attr( get_post_meta( $post->ID, ‘sc_speaker_twitter’, true ) ); 
if( !empty( $twitter ) ) echo ‘<p><a href=”http://www.twitter.com/’; . $twitter . ‘” target=”_blank”>@’ . $twitter . ‘</a></p>’; 
}

6. Update the file.

Was this article helpful to you? Yes No