Toolkit for websites

Removing Page Titles In Thesis

February 2

There were a couple of threads in the DIYThemes forum about removing page titles.  Lots of solutions were thrown out including hiding the title with CSS rules like:

    h1 { display: none;}

While this does work, it’s not really a recommended solution because of the possibility of being construed (by the search engines) as a nefarious, evil, black hat technique. Oooooh *hand waving*.

I suggested that the easiest way is just to chop the titles straight out of the PHP code and be done with it. No need to hide, align, obfuscate or anything tricky on the presentation end.

What’s Involved?

This can be as simple as commenting out 2 lines of code.  If you aren’t comfortable with mucking around with your thesis files, please don’t. But I expect even beginners can achieve this by following the directions. (Famous last words.)

This modification assumes that you don’t need titles to display on any Page (not Posts) within your WordPress website (it removes it from every pages on your site).

Keep in mind — that we are going to modify the php templates within Thesis, not the Custom files.  This is usually a no-no only because if you upgrade your theme (or reinstall for whatever reason), you will lose your changes.  Not the end of the world, but you should keep this in mind and possibly back up your changed files.  (You do back up your site frequently anyway, right?)

Let’s Begin

Just comment out line 36 & 37 from \lib\functions\content.php (This is in Thesis 1.6)

Looks like this below: (starts on line 33)

Thesis Remove Page Titles

Change this:

elseif (is_page()) {
	if (is_front_page())
		echo ' <h2>' . get_the_title() . '</h2>' . "\n";
	else
		echo ' <h1>' . get_the_title() . '</h1>' . "\n";
to this:
elseif (is_page()) {
	if (is_front_page())
		echo ' <h2>' . get_the_title() . '</h2>' . "\n";
	//else
		//echo ' <h1>' . get_the_title() . '</h1>' . "\n";

Things To Consider

The only issue you may see is that the formatting will leave a gap where the title used to be, but that could be worked around with some extra css rules.

Let me Know How It Goes

Did this tutorial answer your questions? Did you use it on your own site?  Please leave a comment.

Did you enjoy this article?   Get more of it...

Subscribe:

If want to get more stuff like this, subscribe now and you'll receive the latest updates instantly by email.

Share It:

  • Twitter
  • StumbleUpon
  • Facebook
  • Digg
  • del.icio.us
  • Reddit
  • Sphinn
  • Posterous
  • HackerNews
  • Mixx
  • Propeller

Follow:

Follow Jim (@jimfmunro) on Twitter here.

Become A Fan:

Become a Fan of Jim on Facebook.

You may also enjoy these related posts:

{ 2 comments… read them below or add one }

Jenn March 15, 2010 at 5:09 pm

Perfect! Thanks so much :)

Reply

Samuel April 13, 2010 at 8:42 pm

solved my problem. Thanks a lot.

Reply

Leave a Comment