Can you post a link and point out what you’re trying to hide? And telling us which theme your using would help.
Thread Starter
gore.m
(@gorem)
Im on localhost. Theme I use is “Underscore” _S, starter theme.
Im trying to remove this (code from html):
<header class="entry-header">
<h1 class="entry-title">Index</h1> </header><!-- .entry-header -->
for specific pages.
Comes from content-page.php template:
<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
</header><!-- .entry-header -->
You can use the is_page function to determine whether to display the title
https://developer.wordpress.org/reference/functions/is_page/
or create an array of post ids you want to exclude, then get the current post ID and if the ID is in that array, skip over outputting the title.
There’s a bunch of ways and lots of conditional functions you can use for your test:
https://codex.wordpress.org/Conditional_Tags
Thread Starter
gore.m
(@gorem)
Thanks you Steve. That is where Im ending…
if ( is_page(array('xxxx', 'xxxx') )) { ....
but I dont know how continue. As I wrote: Im not good in PHP, so WP codex didnt help me too much 🙁 Can you help me to finish it?
thanks you
I’m not good in PHP
Given that, I question your choice to build a theme from _s, as it’s a developer’s theme.
The model for your code should be something like
if ( it's not in this array ) {
do the code to print the title
} else {
probably do nothing
}
Thread Starter
gore.m
(@gorem)
I have everything done, only title is problem, i need solve.