Limit the title into 1 word only
-
I’m trying to limit the title into 1 word only
I tried using this code but it doesn’t return anything..<?php $title = get_the_title(); $names = explode(' ', $title); echo $names[0]; ?>
This is where I’m trying to implement the code If I change the get_the_title() into $names[0] but it doesn’t return anything.
$postheader .= '<h3 class="entry-title"><a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . '</a></h3>';
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Limit the title into 1 word only’ is closed to new replies.