# Custom Condition

**URL:** <https://forum.pinegrow.com/t/custom-condition/7343>\
**Category:** WordPress\
**Created:** [December 8, 2022, 10:12am UTC](https://forum.pinegrow.com/t/custom-condition/7343 "2022-12-08T10:12:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adryan](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Adryan](https://forum.pinegrow.com/u/Adryan)\
**Post date:** [December 8, 2022, 10:12am UTC](https://forum.pinegrow.com/t/custom-condition/7343/1 "2022-12-08T10:12:20Z")

</div>

Hey guys,

I have a simple condition:

```auto
if (get_the_author_meta('ID') != 1) {
    echo "<h1>TEST</h1>";
}

```

It works in a PHP Code block.

I’d like to add that condition to an element, so it only shows when author ID is not 1.

I assume I have to use “If Options” condition, but when I paste “get\_the\_author\_meta(‘ID’) != 1” there, it doesn’t do anything.

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![Adryan](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Adryan](https://forum.pinegrow.com/u/Adryan)\
**Post date:** [January 9, 2023, 7:01pm UTC](https://forum.pinegrow.com/t/custom-condition/7343/2 "2023-01-09T19:01:45Z")

</div>

Can anyone help with this? How can apply a condition to an element created in Pinegrow?

---

<div class="post-metadata">

**Author:** ![matjaz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/matjaz/32/5_2.png) [@matjaz](https://forum.pinegrow.com/u/matjaz)\
**Post date:** [January 12, 2023, 3:37pm UTC](https://forum.pinegrow.com/t/custom-condition/7343/3 "2023-01-12T15:37:08Z")

</div>

> [@Adryan](#):
>
> `get_the_author_meta('ID') != 1`

@Adryan thanks for bumping up the topic.

Use `If options` action to create a custom condition:

Source code:

```auto
<h1 wp-if-custom="get_the_author_meta('ID') != 1">Heading 1</h1>

```

generates PHP code:

```auto
<?php if ( get_the_author_meta('ID') != 1 ) : ?>
    <h1><?php _e( 'Heading 1', 'author_test_block' ); ?></h1>
<?php endif; ?>

```
