# Examples

Source: https://uglydev.com/docs/blocks/examples/
Updated: 20 November 2026

## A call to action

`ugly-blocks/cta/render.php`:

![The call to action block on a page of the site](https://uglydev.com/wp-content/uploads/2026/11/shot-examples-1.webp)

*The call to action block on a page of the site.*

```php
<?php
$link = $block->get( 'button' ); // a link field
?>
<aside <?php echo get_block_wrapper_attributes( array( 'class' => 'cta' ) ); // phpcs:ignore WordPress.Security.EscapeOutput ?>>
	<h2><?php $block->show( 'heading' ); ?></h2>
	<p><?php $block->show( 'text' ); ?></p>

	<?php if ( $link ) : ?>
		<a class="button" href="<?php echo esc_url( $link['url'] ); ?>">
			<?php echo esc_html( $link['title'] ); ?>
		</a>
	<?php endif; ?>
</aside>
```

## A pricing plan with a repeater of features

![The pricing plan block on the site, with its list of features](https://uglydev.com/wp-content/uploads/2026/11/shot-examples-2.webp)

*The pricing plan block on the site, with its list of features.*

```php
<div <?php echo get_block_wrapper_attributes( array( 'class' => 'plan' ) ); // phpcs:ignore WordPress.Security.EscapeOutput ?>>
	<h3><?php $block->show( 'name' ); ?></h3>
	<p class="plan__price"><?php $block->show( 'price' ); ?></p>

	<ul>
		<?php foreach ( $block->rows( 'features' ) as $feature ) : ?>
			<li><?php $feature->show( 'label' ); ?></li>
		<?php endforeach; ?>
	</ul>
</div>
```

## A section that holds other blocks Pro

```php
<section <?php echo get_block_wrapper_attributes( array( 'class' => 'section' ) ); // phpcs:ignore WordPress.Security.EscapeOutput ?>>
	<?php if ( $block->has( 'title' ) ) : ?>
		<h2><?php $block->show( 'title' ); ?></h2>
	<?php endif; ?>
	<div class="section__content">
		<?php ugly_inner_blocks(); ?>
	</div>
</section>
```
