Timeline for Remove Extra Classes from Post Title
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 7, 2018 at 13:04 | comment | added | Narender Chopra | Added it as you said but no effect. Still, WordPress is adding those classes to Post Title. | |
Jul 7, 2018 at 12:51 | comment | added | cjbj | But if you have no idea what your filter actually does it might help to learn a little bit more about php. | |
Jul 7, 2018 at 12:50 | comment | added | cjbj |
Insert it before return $classes;
|
|
Jul 7, 2018 at 12:47 | comment | added | Narender Chopra | I am currently using the following function. May you please let me know where to add the strings provided by you: ` function lsmwp_remove_postclasses($classes, $class, $post_id) { $classes = array_diff( $classes, array( 'hentry', 'type-' . get_post_type($post_id), 'status-' . get_post_status($post_id), ) ); return $classes; add_filter('post_class', 'lsmwp_remove_postclasses', 10, 3); ` | |
Jul 7, 2018 at 12:37 | comment | added | cjbj | This is not jquery but php. You simply add it to the filter you already have. | |
Jul 7, 2018 at 12:28 | comment | added | Narender Chopra | Thanks for the quick answer. Actually, I am looking for a code that I can add to my theme's functions.php to remove these extra classes. I don't want to edit core Wordpress files :) | |
Jul 7, 2018 at 11:45 | history | answered | cjbj | CC BY-SA 4.0 |