<p>You can grab the first word with the split filter according to this <a href="https://stackoverflow.com/questions/24281925/twig-how-to-get-the-first-word-of-a-string">thread</a></p>

<pre><code>{% set array = entry.title|split(' ', 2) %}
&lt;h1 class="section__heading"&gt;
   &lt;strong&gt;{{ attribute(array, 0) }}&lt;/strong&gt;
   {{ attribute(array, 1) }}
&lt;/h1&gt;
</code></pre>

<p>I didn't test this tough.</p>

<p>Edit: there is a <a href="http://twigfiddle.com/j3hfyu" rel="nofollow">Twig Fiddle</a> demonstrating it.</p>

CC BY-SA 3.0
2016-08-18T12:51:24.413Z
Yes thanks KSPR. I found that solution shortly before you posted. Seems to work well.
Terry Upton
CC BY-SA 3.0
2016-08-18T12:02:15.627Z
2016-08-18T12:16:23.033Z
2016-08-18T12:16:23.033Z
KSPR
<p>Site design I am working on the first word of ever page title is bold. The code looks like this;</p>

<pre><code>&lt;h1 class="section__heading"&gt;&lt;strong&gt;Discover&lt;/strong&gt; Riaflex Today&lt;/h1&gt;
</code></pre>

<p>I am struggling to find a simple solution to do this in Craft.</p>

<p>If I setup a simple rich text field then it wraps "p" tags around it. I have tried to used Markdown but this is the same and also end up with ** in the &lt;'title'> output.</p>

<p>Anyone done something similar or can offer a fairly simple approach. I had a quick  attempt at editing radactor but dropped it as it didn't seem to work and remove 'p' tags.</p>

<p>Thanks.</p>

CC BY-SA 3.0
2016-08-18T11:46:57.547Z
Why don't you use a simple text field?
KSPR
CC BY-SA 3.0
2016-08-18T11:48:07.287Z
Do you mean a plain text field? If you do then this is because it won't allow the user to bold the first word.
Terry Upton
CC BY-SA 3.0
2016-08-18T11:50:32.703Z
Yep. How about a separate plain text field for the title and then a rich text field for the rest?
KSPR
CC BY-SA 3.0
2016-08-18T11:57:04.240Z
The problem is that the title needs to have the first word bold.
Terry Upton
CC BY-SA 3.0
2016-08-18T11:59:58.767Z
Ah. now I get it.
KSPR
CC BY-SA 3.0
2016-08-18T12:10:13.833Z
@KSPR's answer is correct. Here is a working demo... http://twigfiddle.com/j3hfyu
Fyrebase
CC BY-SA 3.0
2016-08-18T12:15:48.220Z
Nice :) can you mark my answer as correct?
KSPR
CC BY-SA 3.0
2016-08-18T19:44:10.547Z
@Fyrebase, I moved your answer to a comment since it was a comment. (Just an FYI.)
Matt Stein
<redactor><markdown>
Bold first word in title field
# Bold first word in title field

(Asked by: username_0 on 2016-08-18)

Site design I am working on the first word of ever page title is bold. The code looks like this;
Discover Riaflex Today

I am struggling to find a simple solution to do this in Craft.
If I setup a simple rich text field then it wraps "p" tags around it. I have tried to used Markdown but this is the same and also end up with ** in the <'title'> output.
Anyone done something similar or can offer a fairly simple approach. I had a quick  attempt at editing radactor but dropped it as it didn't seem to work and remove 'p' tags.
Thanks.

**Tags:** redactor, markdown
> **Comments:**
> **username_1**: Why don't you use a simple text field?  
> **username_0**: Do you mean a plain text field? If you do then this is because it won't allow the user to bold the first word.  
> **username_1**: Yep. How about a separate plain text field for the title and then a rich text field for the rest?  
> **username_0**: The problem is that the title needs to have the first word bold.  
> **username_1**: Ah. now I get it.  
> **username_2**: @KSPR's answer is correct. Here is a working demo... http://twigfiddle.com/j3hfyu  
> **username_1**: Nice :) can you mark my answer as correct?  
> **username_3**: @Fyrebase, I moved your answer to a comment since it was a comment. (Just an FYI.)  

---

## 1 answers

### Answer by username_1 on 2016-08-18. Score: 5 | Accepted answer

You can grab the first word with the split filter according to this thread
{% set array = entry.title|split(' ', 2) %}

   {{ attribute(array, 0) }}
   {{ attribute(array, 1) }}


I didn't test this tough.
Edit: there is a Twig Fiddle demonstrating it.

> **Comments:**
> **username_0**: Yes thanks KSPR. I found that solution shortly before you posted. Seems to work well.  

---

