# Reusable Template Part smart action has an issue with hyphens

**URL:** <https://forum.pinegrow.com/t/reusable-template-part-smart-action-has-an-issue-with-hyphens/8279>\
**Category:** Bug Reports\
**Tags:** wordpress\
**Created:** [August 2, 2023, 5:47pm UTC](https://forum.pinegrow.com/t/reusable-template-part-smart-action-has-an-issue-with-hyphens/8279 "2023-08-02T17:47:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adamslowe](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/adamslowe/32/4590_2.png) [@adamslowe](https://forum.pinegrow.com/u/adamslowe)\
**Post date:** [August 2, 2023, 5:47pm UTC](https://forum.pinegrow.com/t/reusable-template-part-smart-action-has-an-issue-with-hyphens/8279/1 "2023-08-02T17:47:47Z")

</div>

Pinegrow tries to use the first hyphenated word as the slug in the get\_template\_parts() function when I have a Reusable Template Part saved in a folder with a hyphen.

For example, I have a partial saved in `template-parts/content/content.php` and when I use the Reusable Template Part smart action, it generates the code:

```auto
<?php get_template_part( 'template', 'parts/content/content' ); ?>

```

when it should be

```auto
<?php get_template_part( 'template-parts/content/content' ); ?>

```

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/5/56d64e04bfe0fa19344781156d911fe279e2953b.png)

Changing the smart action to a regular get\_template\_part() action also splits it incorrectly, but at least it lets me correct it manually.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/e/edf94433476769a4416b5e062b4305cccd61f6d4.png)

Interestingly, this behavior doesn’t happen when I have a hyphen in the ‘name’ portion of the partial file, although I still end up using the non-smart action to split the slug and name the way I want.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/f/ff30fa85444a60599cbb896eda0fa1befb5aacc8.png)

This is an issue since [WordPress guidelines](https://developer.wordpress.org/themes/basics/organizing-theme-files/) suggest that we put partials in the /template-parts directory.

---

<div class="post-metadata">

**Author:** ![MichelyWeb](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/michelyweb/32/6652_2.png) [@MichelyWeb](https://forum.pinegrow.com/u/MichelyWeb)\
**Post date:** [August 10, 2023, 3:30pm UTC](https://forum.pinegrow.com/t/reusable-template-part-smart-action-has-an-issue-with-hyphens/8279/2 "2023-08-10T15:30:13Z")

</div>

I didn’t notice that at all but you’re right. Nice find @adamslowe
