Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter roptech

    (@roptech)

    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 πŸ™‚

    Thread Starter roptech

    (@roptech)

    Any clue, anyone?

    Thread Starter roptech

    (@roptech)

    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

    Thread Starter roptech

    (@roptech)

    Absolutely brilliant, thanks!

    Thread Starter roptech

    (@roptech)

    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)