Skip to:
Content
Pages
Categories
Search
Top
Bottom

Decomposing “author_title” Template Tag

  • @rosebud

    Member

    I am trying to get the User Role on the posts page (that links to the profile) next to the poster name to display, on hover, a span containing this text: “View profile of *user*”. I want to make it clear that clicking on the user title (role) will send the visitor to the user’s profile.

    To accomplish this in a very simple way I need to add a span inside the a tag, like this:

    <a>User Title<span>View profile of <?php post_author(); ?></span></a>

    And then apply simple css rules:

    a span {display: none;}

    a:hover span {display: block;}

    Thus, I need to decompose the template tag “post_author_title” given that this tag already outputs the whole link, so I can’t add the span inside it.

    What I have to do is find a template tag that outputs the User Title in just plain text, and I then recreate the link. I found “get_post_author_title” but I don’t know what it does. When I put it instead of “post_author_title” nothing renders (no text, nor link, nor error).

    I also tried doing this just by css with this markup:

    <a>User Title</a><span></span>

    And playing with the selectors + and >:

    a + span {display: none;} ---> This actually works

    a:hover + span {display: block;} ----> This does not...

    I hope I have been clear with what I want to do. Probably this is a trivial matter and someone could just set me on the right direction.

    Thanks very much for your continuous support.

Viewing 1 replies (of 1 total)
  • @rosebud

    Member

    Anyone willing to lend me a hand here? Have I been clear enough? Should I describe a little bit further what I want to accomplish?

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar