Skip to content

Commit

Permalink
chore(docs): Add @sidebar to the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x committed Jul 29, 2023
1 parent e1aaa90 commit 5df3ba5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/usage/wordpress.md
Original file line number Diff line number Diff line change
Expand Up @@ -519,3 +519,17 @@ This is a directive version of [`wp_body_open`](https://developer.wordpress.org/
@postclass('bg-white')
@postclass('bg-white', $post->ID)
```

## @sidebar

`@sidebar` is a simply directive that calls [`dynamic_sidebar`](https://developer.wordpress.org/reference/functions/dynamic_sidebar/).

It comes with two assisting directives `@hassidebar` and `@endhassidebar` that checks for the existence of the sidebar using [`is_active_sidebar`](https://developer.wordpress.org/reference/functions/is_active_sidebar/).

```php
@sidebar('sidebar-primary')

@hassidebar('sidebar-primary')
@sidebar('sidebar-primary')
@endhassidebar
```

0 comments on commit 5df3ba5

Please sign in to comment.