Forums

If the_author_descrption exists (4 posts)

  1. sepp88
    Member
    Posted 2 months ago #

    Hi there, is a chance to query for an author description. I only want to display a div with the_author_description only if one exists. How can i do that?

  2. Otto42
    Moderator
    Posted 2 months ago #

    $description = get_the_author_description();
    if (!empty($description)) {
    echo '<div>';
    the_author_description();
    echo '</div>';
    }
  3. sepp88
    Member
    Posted 2 months ago #

    thank you! works perfectly!

  4. Paldimo
    Member
    Posted 2 months ago #

    I want to do something similar but with the custom tags, for instance with titles, If I have a custom tag called "meta-title" I'm currently inserting it into the header using the following code;

    <?php $key="meta-title"; echo get_post_meta($post->ID, $key, true); ?>

    could the same code be applied and how?

Reply

You must log in to post.

About this Topic

Tags

No tags yet.