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]
- Hide a specific post from Archive Feed
- Filter and validate user role in registration
- Create a custom theme-specific page, invisible in the admin-panel?
- Post filter Month dropdown at front-end like wordpress backend
- Password protected Page add_filter to change the text doesn’t work
- Show different pages on site depending on user choice
- wp_editor customization
- wordpress filtering out caps in wp_title? (UpperCase is changed to Uppercase)
- What problems could happen if I replaced add_filter and add_action with the function calling
- How to check which submission button was clicked?
- shortcode function outputs multiple anchor tags
- Restrict access to custom post type and filter from every query
- Converting restricted html in comments to bbcode
- How do you assign custom template for Posts page (under Front page displays setting)
- check, if any “add_action” function contains string XXXXXXXXX
- What is the proper/best way to have multiple add_filter for wp-job-manager-resume
- What scope is $blog_url = get_bloginfo() inside a function
- Why none of xmlrpc filters work
- Modify WooCommerce email shipping text value
- WP REST API v2. filters doesn’t work
- How to get to the date of the uploaded file
- How to add more than one custom metadata as filter on the post list page?
- How to use a TinyMCE filter?
- apply_filters to $GLOBALS
- Unable to get WordPress’s apply_filters(‘site_url’) to return a https scheme
- changing size image within the content
- Publish button inside custom field group
- How to filter content in Dashboard?
- How to add class and span to
- String Replace Caching & Chance of Collisions
- Change shortcode output (filter?)
- WP Dashboard -> Posts-> Filter by Category -> Form Method Change : Which Hook
- posts_results filter function memory errors
- How do I add a class to all sidebars to let a Google Custom Search Engine know not to index the content?
- Show child theme for users on specific IP
- How to replace all images in all posts and pages with a different size?
- Display child pages on homepage template
- How to use the filter ‘widget_text’ to a particular text widget with id
- How to filter posts in admin by before date or by post status ‘future’?
- Using Filters To Change Page Title
- The title of an attachment is not working
- Can you create a custom page with content in the center already defined?
- Content template when adding a new page
- Removing a line from a WP core function (comment_template.php) – filter or other technique?
- Execute php in pages
- Filter for wp_embed_handler_youtube not working
- filter wptexturize doesn’t work on old posts titles
- custom page or standalone page?
- Post Type Upload Directory – {post_type}_upload_dir filter
- How to remove a filter that is an anonymous object?
- Custom search fields and AJAX support
- is_page_template() doesn’t work with excerpt_length filter
- Avada Theme – Display results from a specific category [closed]
- How to display time when page is created and edited
- remove_action conditionally for Custom Post Type – not working
- Why isn’t my link attribute getting my css?
- Custom xmlrpc request does not pass parameters?
- add_filter not adding the filter
- Adding to an array & passing it through do_action/apply_filters
- wp.getPosts with status = ‘trash’ using node.js
- How to add a class to Buddypress avatars in the Activity stream? [closed]
- Call a function on every wordpress pages only
- using posts_where for meta data on pre_get_posts
- Hook into ‘when user logs in’ [persistent login]
- Specify parent page template
- Filter on widget-title does not work with custom links
- WP Template Hierarchy – Need help choosing the correct templates
- Can’t get content of all (19) posts – Incomplete Chunked Encoding
- Admin filter/error if post title is too long
- Is it possible to include the add_filter() function within a shortcode function
- Custom registration field to SQL database
- Activate short codes for all post queries?