Remove Page Titles
-
Hi All, My question is on removing page titles. I know you can remove them using the custom CSS
.post-title, .post-title a, .post-title a:visited {
display: none;
}But now if I click on a parent page which lists all the sub pages underneath I lose the page titles which I want to keep.
Any idea how I can amend the CSS to keep the page titles when a parent page is selected, and remove the title when a page is opened.
Hope this makes sense.
Thanks
Provide me with the two links showing both pages; the “actual page” and it’s “parent page”.
Here are the links. I currently have the option for page titles switched off
Link to a page
http://wp.qdevsuite.com/controls/qribbon/
Link to the parent
Okay. Go ahead and re-enable the page titles again.
We are probably going to have to use a conditional in php to check if the page being rendered is a single page. Something like:
if (is_page()) {
?><style type="text/css"> <!-- .post-title, .post-title a, .post-title a:visited {display: none;} --></style><?php
}Are you using a child theme?
Mod
Maybe
.single .post-title,
.single .post-title a,
.single .post-title a:visited {
display: none;
}?
Good call, Ken. I modified my code above.
is_single()is for a post, whileis_page()is for a page.So, using the same logic… this might work just using css:
.page .post-title,
.page .post-title a,
.page .post-title a:visited {
display: none;
}Not sure… but definitely easier than custom php.
Try this,
.post-title, .post-title a, .post-title a:visited {
display: none;
}
.child-page .post-title, .post-title a {
display: block !important;
}
Viewing 10 posts - 1 through 10 (of 16 total)
- 1
- 2
- You must be logged in to reply to this topic.
