Community Forums › Forums › Archived Forums › Design Tips and Tricks › Remove h1 / title-area in HTML4 / XHTML Theme
- This topic has 8 replies, 3 voices, and was last updated 8 years, 10 months ago by
Carlo.
-
AuthorPosts
-
January 30, 2015 at 12:00 pm #139060
anotherusername
ParticipantHi all:
http://www.marinhomephotography.com/
Using Agency pro 2 (which is an HTML4 / XHTML theme) how would I remove the h1 tag that is wrapped around the <title> area (which in my case wraps around an image) on the home page?
Or how do I get rid of the whole title area on the home page?
<div id="title-area"><h1 id="title"><a href="http://www.marinhomephotography.com/"></a></h1></div>
Thanks in advance.
http://www.marinhomephotography.com/January 31, 2015 at 4:09 pm #139205TREagans
Member//REMOVE PAGE TITLES FROM SPECIFIC PAGES
add_action( 'get_header', 'remove_titles_from_pages' );
function remove_titles_from_pages() {
if ( is_page(array(contact, about, home, services, courses, portfolio) ) ) {
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
}
}
Web Designer and Developer
http://www.treagans.comJanuary 31, 2015 at 4:39 pm #139210anotherusername
ParticipantThanks for the code.
I am fairly certain that is for html5 code and not for XHTML sites.
I decided to take the easy way out and used the genesis simple hooks plugin and just clicked the:
Unhook genesis_do_header() function from this hook?
Button.
February 1, 2015 at 9:43 am #139270Carlo
MemberThanks for the code.
I am fairly certain that is for html5 code and not for XHTML sites.
It is indeed, but that's the least of the problems with it. Using that code would have brought down your site!
Thas, you should have tested it before posting it. Also, saying hello and introducing the code in your own words instead of just posting the code alone wouldn't hurt.
I decided to take the easy way out and used the genesis simple hooks plugin and just clicked the:
Unhook genesis_do_header() function from this hook?
Button.
Good idea.
February 1, 2015 at 10:48 am #139287anotherusername
ParticipantHi there, Carlo:
Thanks for your note.
In case anyone wants to go the simple hooks route and just use:
Unhook genesis_do_header() function from this hook?
Do note that you will want to probably put a div in there with a margins, since you are losing a div (sorry, off the top of my head I don't remember what the DIV Id is... maybe just #header ???).
Hope this helps.
February 1, 2015 at 11:28 am #139292TREagans
Member@carlo.... I actually have this code added to my functions.php in child theme and its giving me the results I was looking for. What do you mean it would bring your site down?
Web Designer and Developer
http://www.treagans.comFebruary 2, 2015 at 5:04 am #139365Carlo
Member@carlo…. I actually have this code added to my functions.php in child theme and its giving me the results I was looking for. What do you mean it would bring your site down?
I guarantee you don't. Try copying and pasting what you posted and see what happens...
Firstly, those items in your array should be formatted as strings. Secondly, when posting code on the forum, you need to put it inside a code block (use the code button in the editor) or the string marks are auto converted into quotation marks.
February 2, 2015 at 11:43 am #139421TREagans
Member@Carlo Not to argue with you or nothing, but as you can see, i'm running that code as is in my functions.php. I'm trying to use this as a learning experience. So you're saying the page names should be in quotes so that they become strings? Using the code listed removes my page titles with no issue. Soon as I add the page name to the list, the title goes away upon refresh.
</TREagans>
Web Designer and Developer
http://www.treagans.comFebruary 3, 2015 at 5:31 am #139501Carlo
MemberSo you’re saying the page names should be in quotes so that they become strings?
Yes, that's exactly what I'm saying.
Using the code listed removes my page titles with no issue. Soon as I add the page name to the list, the title goes away upon refresh.
Well if you look at the codex entry for is_page, it confirms that the contents of the array should be strings.
Regardless of whether it works even if it's formatted wrong, if the asker had copied and pasted the code you posted, their site would have crashed, because the StudioPress forum corrupts code if it's not formatted as a code block.
-
AuthorPosts
- The topic ‘Remove h1 / title-area in HTML4 / XHTML Theme’ is closed to new replies.