Under the premise, that website-link-project
is the key of the postmeta in question and you know the post’s ID (or this being in The Loop, respectively):
<?php
/* store post ID and metadata in variables */
$postid = get_the_ID();
$website_link = get_post_meta( $postid, 'website-link-project', true );
/* output some HTML on the condition of $website_link being meaningful */
if ( ! empty( $website_link ) ) {
echo '<div class="websitebutton">' . $website_link . '</div>';
}
?>
The above might work as is, depending on whether my assumptions were correct.
Note that I don’t know the plugin you are using at all.
get_the_ID
will only work within The Loop, if you’re somewhere else, you’ll have to grab the ID from elsewhere as well.
get_post_meta
is WP’s native function for retrieval of post metadata. Your plugin might provide additional ones.
As for the conditional in the above:
PHP’s empty
pretty much does what its name tells you – it checks whether a variable is considered “empty” (''
a string with no characters, array()
empty array, NULL
, false
, 0
integer zero, and such). Since we want the condition to be evaluated to true
if the variable is not empty, we negate the expression with a !
.