Title: roptech's Replies | WordPress.org

---

# roptech

  [  ](https://wordpress.org/support/users/roptech/)

 *   [Profile](https://wordpress.org/support/users/roptech/)
 *   [Topics Started](https://wordpress.org/support/users/roptech/topics/)
 *   [Replies Created](https://wordpress.org/support/users/roptech/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/roptech/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/roptech/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/roptech/engagements/)
 *   [Favorites](https://wordpress.org/support/users/roptech/favorites/)

 Search replies:

## Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)

 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Adding post Custom Field to content.php](https://wordpress.org/support/topic/adding-post-custom-field-to-contentphp/)
 *  Thread Starter [roptech](https://wordpress.org/support/users/roptech/)
 * (@roptech)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/adding-post-custom-field-to-contentphp/#post-6362763)
 * I actually managed to figure it out myself from trial/error/looking at other 
   working code.
 * For anyone interested:
 *     ```
       <?php
       $key = 'SCurl';
       $themeta = get_post_meta($post->ID, $key, TRUE);
       ?>
       <?php if($themeta != '') : ?>
       <div class="entry-single-info">
       	<span><strong>Soundcloud:</strong> <a href="http://soundcloud.com<?php $scurl = get_post_meta( get_the_ID(), 'SCurl', true); if( ! empty( $scurl ) ) { echo '' . $scurl . ''; } ?>" target="_blank"><?php $scurl = get_post_meta( get_the_ID(), 'SCurl', true); if( ! empty( $scurl ) ) { echo '' . $scurl . ''; } ?></a></span>
       </div>
   
       <?php else : ?>
   
       <?php endif; ?>
       ```
   
 * This shows, e.g. “Soundcloud: /soundcloudlink (<< that being a link to the soundcloud)
   if the custom field named SCurl exists and has data. There is probably a cleaner
   way to do this, but it works for me 🙂
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Adding post Custom Field to content.php](https://wordpress.org/support/topic/adding-post-custom-field-to-contentphp/)
 *  Thread Starter [roptech](https://wordpress.org/support/users/roptech/)
 * (@roptech)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/adding-post-custom-field-to-contentphp/#post-6362747)
 * Any clue, anyone?
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Adding post Custom Field to content.php](https://wordpress.org/support/topic/adding-post-custom-field-to-contentphp/)
 *  Thread Starter [roptech](https://wordpress.org/support/users/roptech/)
 * (@roptech)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/adding-post-custom-field-to-contentphp/#post-6362728)
 * Is it possible to put in place an if statement that says if there is a custom
   field with the name of RoR, then show X?
 * Like:
 * IF {custom field name} exists
 * {content here}
 * ENDIF
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Adding post Custom Field to content.php](https://wordpress.org/support/topic/adding-post-custom-field-to-contentphp/)
 *  Thread Starter [roptech](https://wordpress.org/support/users/roptech/)
 * (@roptech)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/adding-post-custom-field-to-contentphp/#post-6362696)
 * Absolutely brilliant, thanks!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Category archive posts as excerpts – baffled](https://wordpress.org/support/topic/category-archive-posts-as-excerpts-baffled/)
 *  Thread Starter [roptech](https://wordpress.org/support/users/roptech/)
 * (@roptech)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/category-archive-posts-as-excerpts-baffled/#post-6354939)
 * I think I may have cracked it in my own way… is there a better way than doing
   this? Changed a section in _content.php_ to:
 *     ```
       <?php if ( is_single() ) : // Only display Full post for single ?>
       	<div class="entry-content">
       		<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?>
       		<?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
       	</div><!-- .entry-content -->
       	<?php else : ?>
       	<div class="entry-summary">
       		<?php the_excerpt(); ?>
       	</div><!-- .entry-summary -->
       	<?php endif; ?>
       ```
   
 * So only the full post on it’s own page shows anything but the excerpt.
 * Am I missing a very easy way of adding “…” and “read more” for the excerpt?

Viewing 5 replies - 1 through 5 (of 5 total)