How do I hide the current page's title?
I have this code:
add_filter( 'the_title', function() {
return "";
});
Or, respecting the hook's arguments:
function remove_title( $title, $id ) {
$title = '';
return $title;
}
add_filter( 'the_title', 'remove_title', 999, 2);
Which is being placed in a custom made page, my template (used by that page) being:
get_header(); ?
div id="primary" class="content-area"
main id="main" class="site-main"
header class="entry-header"
?php the_title('h1 class="entry-title"', '/h1'); ?
/header!-- .entry-header --
?php
while ( have_posts() ) :
the_post();
?
article id="post-?php the_ID(); ?" ?php post_class(); ?
?php
the_content();
?
/article!-- #post-?php the_ID(); ? --
?php
endwhile; ?
/main!-- #main --
/div!-- #primary --
?php
get_footer();
Topic get-the-title page-template filters pages Wordpress
Category Web