# Print a text

Source: https://uglydev.com/docs/how-do-i-print-values/print-a-text/
Updated: 20 November 2026

**You want:** to show a text field (a headline, a name, a phone number) on your page.

## How

```php
<h1><?php ugly_show( 'headline' ); ?></h1>
```

`ugly_show()` prints the value **already escaped for its type**: you do not choose between `esc_html()`, `esc_url()` and `wp_kses_post()` on every line.

## When you need the value in code

```php
$headline = ugly_get( 'headline' );
if ( $headline ) {
	echo '<h1>' . esc_html( $headline ) . '</h1>';
}
```

`ugly_get()` gives the raw value, so **you** escape it. Use it to compare, to build a string or to pass the value to another function.

## What you get

| Function | Returns | Escaped? |
| --- | --- | --- |
| `ugly_show()` | Prints it | Yes, for the type of the field |
| `ugly_get()` | The value (or `null`) | No: you do it |

> **Related:** [ugly_get() or ugly_show()?](https://uglydev.com/docs/php-api/ugly-get-or-ugly-show/) explains which one to choose, and [the functions at a glance](https://uglydev.com/docs/functions/at-a-glance/) has them all.
