WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] raquo and need to strip whitespace from title (3 posts)

  1. jami1955
    Member
    Posted 3 years ago #

    Hi
    I've read four posts on how to strip the raquo from the wordpress post title. But I have some javascript which needs to call the title from the present post, and it is including the whitespace. I've stripped the raquo from the title, but the whitespace is still there. Here is the javascript:

    <script language="javascript"><!--
    	$(document).ready(
    	function (){
    		$("<?php wp_title(''); ?>").PikaChoose();
    	}); --></script>

    That is returning this:

    <script language="javascript"><!--
    	$(document).ready(
    	function (){
    	        $("  Gallery1").PikaChoose();
    	}); --></script>

    See the space before the post name "Gallery1" in the second string which is what is printed in the head? How can I remove that space?
    thanks,
    JSC

  2. Joseph
    Member
    Posted 3 years ago #

    Try this:

    <?php echo trim(wp_title('', false)); ?>
  3. jami1955
    Member
    Posted 3 years ago #

    excellent, thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic