Create citation and url in post using 3 custom fields with conditions for each field… So close!
I’m not sure if I’m meeting all of your requirements here, but I think this might work. <div class=”source”> <?php $name = get_post_meta($post->ID, ‘sourcename’, true); $url = get_post_meta($post->ID, ‘sourceurl’, true); $title = get_post_meta($post->ID, ‘sourcetitle’, true); $snippet = str_replace( “http://”, “”, $url ); $snippet = substr( $snippet, 0, 22 ) . “…”; if ( !empty( $title … Read more