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 trialSarah Jee Watson
UX Design Techdegree Graduate 28,197 PointsMy 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..
Christopher Arter
69 PointsYou mentioned Bootstrap. What are you doing with bootstrap exactly?
Sarah Jee Watson
UX Design Techdegree Graduate 28,197 PointsChristopher, I have been following the Bootstrap to WP tutorial, so creating a WP theme using bootstrap.
Sarah Jee Watson
UX Design Techdegree Graduate 28,197 PointsHi Martin, No to that, just working though the WP to Bootstrap Tutorials.
Sarah Jee Watson
UX Design Techdegree Graduate 28,197 PointsJust been prompted to mark the best answer but haven't found one yet. Any more suggestions much appreciated! :)
2 Answers
David Richied
18,057 PointsFound 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.
Sarah Jee Watson
UX Design Techdegree Graduate 28,197 PointsPerfect, thank you David. Why does that worK?! And in answer to your question, to add the code - sans hack :) - I followed these steps: https://teamtreehouse.com/community/posting-code-to-the-forum
David Richied
18,057 PointsYou'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 = '»', $display = true, $seplocation = '' ) {
lots of code
}
» 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
Sarah Jee Watson
UX Design Techdegree Graduate 28,197 PointsThanks again David. I'll be off to 'Wordpress Hooks and Filters' then...
Martin Wildfeuer
Courses Plus Student 11,071 PointsMartin Wildfeuer
Courses Plus Student 11,071 PointsDid 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.