How to remove dashes from post name without PHP use
-
I have this template code that stopped working because of PHP use:
<h3>Stories written:</h3>
[if stories_written]
<ul class="stories">
[each stories_written]
<li>
<?php $name_tr = str_replace('-', ' ', $obj->display('post_name'));
$name_tr = ucfirst($name_tr); ?>
<a href="{@permalink}"><?php echo $name_tr ?></a>
</li>
[/each]
</ul>
[else]
No stories found
[/if]I have quickly changed it to:
<h3>Stories written:</h3>
[if stories_written]
<ul class="stories">
[each stories_written]
<li>
<a href="{@permalink}">{@post_name}</a>
</li>
[/each]
</ul>
[else]
No stories found
[/if]It works now, but I have dashes in post names. Is there a way to remove dashes without using PHP?
Thank you
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.