You can try this
function wpb_hidetitle_class($classes) {
if ( is_single() || is_page() ) :
$classes[] = 'hidetitle';
return $classes;
endif;
return $classes;
}
add_filter('post_class', 'wpb_hidetitle_class');
CSS code :
.hidetitle .entry-title {
display : none;
}
Source http://www.wpbeginner.com/plugins/how-to-hide-post-and-page-titles-in-wordpress-single-pages/
Related Posts:
- Adding Filter | Page Title | Template | Why the_title affecting on menu?
- Include a page template along with add_theme_support()
- Remove “Private” + “:” in title does not work
- Changing document title only on a custom page template
- How Can I Have A URL Changed Based on the Originating URL?
- get_title without filter(the_title)
- WP action/filter to modify title before header output and article output?
- Create Page Template by hook programatically in Functions.php in WP 5.8.1
- Don’t see add_filter result in the site front page
- page_attributes_dropdown_pages_args filter does not work
- Access get_the_title() from ‘excerpt_length’ filter
- Prevent menu from loading in a page template [duplicate]
- include specific Pages to wp_list_pages with filter
- Alter existing page contents based on url
- How do I hide tinymce within the edit screen of a particular page
- Shorten the title length
- Strip $before & $after strings from a page title
- Filter the title to only affect the_title() template function
- Modify WordPress Page Title ()
- how to output HTML tags in post_content and not as plain text
- How to filter page title for certain page?
- Change URLs in default WordPress slider to relative from absolute
- What action/filter can be used for modifying the page to be rendered?
- Remove action added from class
- Hide H1 Title using the_title filter
- Custom Filter using meta_value in wordpress admin list not working
- Add HTML to Page Content
- Conditionally including JS based on whether ACF field is set [closed]
- Not able to change wp_title using add_filter
- How to hook a filter to catch get_post_meta when alternate a custom field output?
- Changing JPEG compression depending on image size
- Advanced Custom Fields and Yoast SEO keyword analysis [closed]
- Insert Custom HTML After Shortcode
- Is there a way to add another row to the tinyMCE kitchen sink toggle?
- What do add_filters() and apply_filter() do?
- add_filter to youtube embeds?
- SSL certificate for the host could not be verified
- Store source permalink on XMLRPC calls
- How to limit the pages displayed for choosing parent page on page attribute’s menu?
- How to inject custom url path for page ?
- how to show all post in my page-grid.php template page
- How can I reliably and globally disable wptexturize?
- Customise Jetpack Publicize text
- Can’t change a label in woocommerce with the normal filter
- WordPress RSS feed – filter RSS content by custom field value
- What is the filter hook for custom fields content?
- Filter keywords from search query
- Add classname to the_category() function?
- Filter the URL of next_posts_link & previous_posts_link
- How to make certain page templates visible to admin only
- Explanation for remove_filter used in the below code [closed]
- How to change the blog title with add_filter? details below
- How To Get User Data in Callback Function for pre_user_nicename?
- Editing
- the_content filter – checking the post
- add_filter to apply_filters that exists within class
- Which built-in WordPress files are safe to edit?
- How do I target a single page to modify the comment form of only that page?
- How to add a filter to get_the_author_meta?
- When does a function assigned to the content_filtered_edit_pre filter hook fire?
- Capture post content before page renders
- Get the url of a page template without using the page slug and ID
- How to pass variables to custom filter from multiple functions
- the_content filter together with require_once returns 1 instead of the content of the included file
- Missing Argument 2 for apply_filter
- Detect when gutenberg editor title is available in Dom after editor load
- How to apply a filter to an ACF wysiwig editor field output?
- Show author on every sub-page
- Is it possible to bind a function to a filter hook via Ajax?
- Add a filter to an action [closed]
- Dynamic href link to Contact Page
- Hide Posts In Back-end/Admin Based On User’s (Pseudo) Privileges Controlled by ACF
- Filter Pages by Custom Field (ACF) in admin area
- Remove tags without a specific meta key from “choose from the most used tags”
- Injecting pre-defined text from custom page template to editor
- Which Filter Do I Use To Modify The Subject Of The Retrieve Password Notification Email?
- automatic title through filter
- Buddypress Filter Multiple Activities [closed]
- Custom folder for wordpress page templates
- How to apply filter on get_the_post_thumbnail()
- How do I check if I can use the allowed_block_types filter?
- Action for opening attachment or manipulating all attachment links
- Filter wp_mail based on content type
- Remove the post_content search from WHERE clause (and CONCAT sql function)
- mu-plugins body_class filter not working
- Post filter Month dropdown at front-end like wordpress backend
- Show different pages on site depending on user choice
- shortcode function outputs multiple anchor tags
- WP Dashboard -> Posts-> Filter by Category -> Form Method Change : Which Hook
- Show child theme for users on specific IP
- Display child pages on homepage template
- wp.getPosts with status = ‘trash’ using node.js
- Is there a way to overwrite a filter used in canonical.php?
- How do I remove certain HTML elements with specific classes from the feed?
- confusion with add_filter
- post->post_content filter
- Adding a filter to wp_edit_posts_query() to prevent hierarchical display of pages
- How to change this WP logo and posts url in block editor?
- Change password reqts with NO plugin without breaking resetpass link?
- How can I conditionally add the filter option_home?