Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress From Bootstrap to WordPress Create Bootstrap Styled Theme Templates Creating a Basic Blog Listing Template

Sarah Jee Watson
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Sarah Jee Watson
UX Design Techdegree Graduate 28,197 Points

My Blog Page has acquired '>>' before the title 'Blog' at the top of the page.

My Blog Page has acquired '>>' before the title 'Blog' at the top of the page. I can't see where this is coming from!

    <!--Show blog page title (wp_title not the_title)-->
    <div class="page-header">
        <h1><?php wp_title(); ?></h1>
    </div>

Nothing extra here. And search on all pages for '>>' returns nothing. I can see this in inspector:

<div class="page-header"> <h1> >> Blog</h1> </div>

But can't find it in the code anywhere..

Martin Wildfeuer
Martin Wildfeuer
Courses Plus Student 11,071 Points

Did you install a SEO plugin? They tend to change the way titles are displayed. Yoast, for example, let's you choose the separator style in settings.

You mentioned Bootstrap. What are you doing with bootstrap exactly?

2 Answers

David Richied
David Richied
18,057 Points

Found it. You just need to add an empty argument (a pair of single quotes) in your wp_title function).

Change

<pre> <span class="c"></span> <h1><?php wp_title(); ?></h1> </pre>

to

<pre> <span class="c"></span> <h1><?php wp_title(''); ?></h1> </pre>

Now, maybe you can help me by showing me how you got your code to be formatted in that way. Wrapping my code in three back ticks doesn't seem to be working.haha. I got the above formatting to work by wrapping it in some pre and span tags I got by looking at the source html of your code.

David Richied
David Richied
18,057 Points

You're welcome. :D. To answer your question, if no arguments are given by the user when using wp_title, ">>" is the default argument for the separator as you can see in the wp_title() function in general-template.php in the core files of WordPress: <div>

wp_title( $sep = '&raquo;', $display = true, $seplocation = '' ) {
         lots of code
}
&raquo is the same as >>

</div> I'm pretty sure that's what was causing ">>" to pop up, but I'm not sure why it came before the title. If you're wondering how I know that, I coincidentally found it out by watching the next course in this track called WordPress Hooks and Filters.

And thanks for syntax. :D