Title: PHP echo with a function tag inside a HTML element
Last modified: August 21, 2016

---

# PHP echo with a function tag inside a HTML element

 *  [Shmoo](https://wordpress.org/support/users/macpresss/)
 * (@macpresss)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/php-echo-with-a-function-tag-inside-a-html-element/)
 * This is probably very easy for somebody with PHP skills and I think I’ve done-/
   seen it before but can’t remember where.
 * This is what I made.
 *     ```
       function shmoo_time_switch_if_has_replies() {
       	if ( bbp_get_topic_reply_count() ) {
       		// topic_author + time_ago
       		echo bbp_topic_author_display_name() . " " . bbp_get_topic_post_date( $topic_id = 0, $humanize = true, $gmt = false );
   
       	}
       	else {
       		// topic_author + last_reply and his time_ago
       		echo "something else";
   
       	}
       }
       ```
   
 * Now I would like to wrap that author_display_name in an HTML **a href** tag with
   another function that leads to the url (profile-page)

The topic ‘PHP echo with a function tag inside a HTML element’ is closed to new 
replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Shmoo](https://wordpress.org/support/users/macpresss/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/php-echo-with-a-function-tag-inside-a-html-element/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
