How do I hide the main page title

Use this forum to ask questions about how to do things in GuMax skin.

Re: How do I hide the main page title

Postby jack2smith1988 » July 1st, 2012, 12:43 pm

MediaWiki does not have a built-in option to hide the main page title (see bug 6129), but you can use CSS to hide the title. Alternately, you can use the NoTitle extension.
Method 1 (css)

Add the following to MediaWiki:Common.css on your wiki: h1.firstHeading { display:none; }

If this doesn't work, look at the HTML source code to find the correct class to replace "page-Main_Page" with:

<body class="mediawiki ns-0 ltr page-Some_title">

If no unique class exists, then you cannot use this. You may be using a custom or outdated skin.
Method 2 (display title)

Add the following line to any page you want to disable showing the title for (requires setting $wgRestrictDisplayTitle to false)

{{DISPLAYTITLE:<span style="display:none">{{FULLPAGENAME}}</span>}}

FULLPAGENAME is not required, so if it does not need to be present (for screen readers, bots, etc), you can remove it as follows:

{{DISPLAYTITLE:<span style="display:none"></span>}}

This method will still leave a horizontal rule in the title's former position.
User avatar
Rank 0
Rank 0
Posts: 1
Joined: July 1st, 2012, 12:30 pm


Return to GuMax 'How Do I' Questions

Who is online

Users browsing this forum: No registered users and 1 guest