I’ve a output template ( from some product research), using the_content()
of a page.
I’d like to exclude one class from the_content()
(which is from a page using Default template).
I’ve seen it was possible using a function, but how to realize it? I’ve only found to exclude shortcode which I’m not looking to do . . .
thank you in advance 🙂
Open up your
header.php
file. Right before the closing</head>
tag you’ll want to include the following code.Alternatively you could use a conditional PHP statement wrapped around some CSS inside the
<head></head>
tags to hide it. Again, you would do this in theheader.php
file. Using the conditional statement you could tell the CSS to only work on a specific page and not affect any other pages. See below.If you go the CSS route, you would set the page ID of the page you want the CSS to affect by changing the number 1 inside of
is_page(1)
to the appropriate page ID. You could also use the page slug, so in place of the number 1 you could use'your-page-slug'
. You can read up on theis_page()
function here.Hopefully this helps.