• Hi there,

    I would like to add this tag: ‘<?php the_author_description(); ?>’ within this tag: ‘<?php the_content(‘<span class=\”more\”>Read full entry</span>’); ?>’

    Is that possible at all?

    Basically I want authour_description to be within the < p > tags of the content.

    Can I ?

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Not sure…. most of the WP tags output their content directly to the browser, rather than leting it be passed back (a matter of contention between the devs & some users). If the the_author_description tag has a parameter that allows you to set if it’s echoed back or not (you want the “or not” option) then, yes, it can be done. If it doesn’t have such an option (for the most part, I think it’s called “output”) then you may be out of luck.

    Tg

    The problem isn’t getting the author description information so much as injecting it inside the content. Overall I’d say “no”. That doesn’t mean you can’t have both the content and the author information inside a single containing div, but you’re not going to get it “within the < p > tags of the content”.

    Many WP functions come in two flavors: echoing and non-echoing. In general, most of the template tags are echoing. But most template tags have a non-echoing version.

    For example, the_author() displays the author’s name of the current post. There exists a function get_the_author() that returns the name of the author of the current post without displaying it to the reader. Most, but not all, template tags have a corresponding get_* function that does not echo.

    As for the original query, can you display the post author inside the_content(), the answer is no. the_content() doesn’t allow one to change the contents of The Content; it only allows you to modify what is displayed for the “Read More…” link.

    Thread Starter elyonline

    (@elyonline)

    Ah ok – thanks guys.

    I was trying to achieve this:

    ‘< p ><img alt=”my name” class=”user-ident” src=”/wp-images/thumb-karl.jpg” />Spme stuff here and so on < / p >’

    With the image tag being pulled from authour_description so when I post my pix was inside the first p tag.

    Thanks for the insight though ??

    So the answer to TPO seems to be yes. The question is a bit ambiguous but WP template tags can be wrapped up inside html at any point.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Can you put a WP tag within a tag?’ is closed to new replies.