• i have a custom field with 2 names ( Mood and style ) and their values are links. i managed to make 1 link clickable but for some reason the name doesn’t show. Only the value as a clickable link( which is what i wanted but with the name of the value in front ). Also the second name does not show, along with its value…This is the code im using to insert it into a hook and then edit it with css. Im hoping some one can help me out here. Thank you.

    example of what i wanted

    (Name) (value)
    Mood : https://yahoo.com
    Style : https://msn.com

    my code makes the value( yahoo.com ) in “Mood” clickable but the name
    ( Mood) doesnt show. “Style” and its value just dont show up at all.

    code used

    <?php if(is_single() ) { ?>
    <h6 class=”meta-fields”><?php $text = get_post_meta( get_the_ID(), ‘Mood’,’Style’, TRUE );
    echo make_clickable( $text ); ?></h6>
    <?php } ?>

    hopefully some one can help me out here. Thank you

Viewing 1 replies (of 1 total)
  • Thread Starter deltamatrix

    (@deltamatrix)

    Ok forget it guys. I got it. Just figured it out. if this helps anyone out then heres what worked.

    <?php if(is_single() ) { ?>
    <h6 class=”meta-field”>Source : <?php $text = get_post_meta( get_the_ID(), ‘Mood’, TRUE );
    echo make_clickable( $text ); ?></h6>
    <h7 class=”meta-field”>Via : <?php $text = get_post_meta( get_the_ID(), ‘Style’, TRUE );
    echo make_clickable( $text ); ?></h7>
    <?php } ?>

    this would show 2 custom fields with clickable links from their values ONLY in the post pages but nor on the front page..if you want to show these in every page delete if(is_single() ) {?>
    you can change the names(mood,style) the header tag number, and class names to suit your editing needs.

Viewing 1 replies (of 1 total)
  • The topic ‘Make Custom Filed Data into a clickable link.’ is closed to new replies.