You could use jquery to split the title into letters and apply the class. That would work for any html page, regardless whether it was made by WordPress, Drupal, some dude that is stuck with Dreamweaver or whatever.
The WP way would be different. If you’re new this is fairly complex, but a good start if you’re willing to learn. The title of a WP post is generated by a function called get_the_title
. This function ends with a filter, that allows you to modify the resulting title. Like this, which you would put in the functions.php
file of your child theme:
add_filter ('the_title', 'wpse263471_split_title');
function wpse263471_split_title ($title) {
... do stuff ...
return $title;
}
In the place of ‘do stuff’ you would have to write php code that splits $title
into letters, adds <span class=slant>
around them and then glues $title
together before returning it.
Related Posts:
- Add class to before_widget for all widgets with a dropdown and a counter
- Tiny MCE custom styles, and preview in the backend
- How to define and link full path to css located at a random folder on header.php
- How to add custom css file in theme?
- CSS not updating in browser when I change it
- Do I actually need to link my theme’s style.css in the theme files
- CSS classes for theme
- How to remove the Theme Customization Button from the dashboard and themes options page?
- Change admin bar to default:off
- Splitting WordPress theme CSS into multiple files, good or bad?
- Edit srcset and sizes attributes in Gutenberg image, cover and gallery – blocks
- Suggestions for creative use of post format feature, or themes that use them well
- Why max-width:97.5% on content images?
- Add a preview to a WordPress Control Panel
- use add_action(‘wp_head’) in a widget for generating dynamic CSS styles
- Setting up partial Right-to-Left admin interface
- Adding inline styles from a widget
- Get password when user registers and save it sha1 into database
- CSS in child theme not overriding the parent theme [closed]
- How to add (css) classes to only one wp_nav_menu()?
- Adding dashicon fonts to the admin of pre 3.8 installs
- Move my theme style.css into a folder
- How to keep theme layout the same when admin gray bar is present?
- Enqueued Stylesheets Effecting Admin Styles
- wp_head() not inserting the default stylesheet style.css
- Writing Clean WooCommerce Styles
- First completely customized theme, where should I start?
- De-registering parent style sheet css recommended?
- Alterntives to BEM syntax that comply with WordPress coding standards? [closed]
- WordPress default theme css units
- Where is definied the theme location for the main menu in a WordPress template?
- current-menu-item class not working
- How to determine which custom header image is being shown
- enqueue_style is not working
- How do the default themes reference style.css?
- Multiple Page Templates & CSS
- Is it possible to edit the styling of the admin panel from within a custom theme?
- When trying to override plugin’s function by theme, my filter executes two times, I want it to run only a single time
- Menu item added in wp_nav_menu_items filter is never highlighted
- Theme Loading Into Dashboard
- What are the Entry classes for?
- Pass variable to hook. Its possible?
- How to edit my theme for full width?
- How to check if a WordPress core block is active in sidebar
- Which html elements should be styled in wordpress theme
- How to add styles set by user in the customizer
- Font Awesome 5 Free – far working but fas is not? [closed]
- How remove render blocking css from wordpress when you build a theme?
- Why doesn’t my css work when I check my theme on mobile devices? [closed]
- Following Web Performance Optimization techniques to output static and dynamic css
- How can I add custom text styles to the visual text editor?
- Displaying icon image for WordPress post formats, is there a cleaner way to do this?
- Internal Stylesheet in WordPress Theme development
- How to change footer or for different kinds of users in wordpress?
- Replace single_template filter with what for default posts?
- Theming Using Bootstrap Glyphicons and WordPress Dashicons
- Broken theme, template is missing
- Having issue with WordPress wp_enqueue_style
- CSS class on last post in loop ( custom query )
- How to change footer credit text in Twenty Twenty One theme with a hook?
- Use a filter on menu items that have children
- theme-independent CSS/JS files
- How to style bootstrap container in wordpress theme?
- How to override template files in parent theme?
- LESS not working in WordPress [closed]
- Place title (in correct place) above image with opaque background [closed]
- CSS preprocessor file messed up after compiled
- Customize Option Framework
- Some doubts about WordPress handle the horizontal main menu visualization
- Filter didn’t work on content class (hybrid_post_attributes)
- Can’t change theme name
- my single.php is mixup on some post for no reason
- How to use the _S framework
- How to format the first line of a post differently?
- Pagination don’t work with active filters
- How to create a robust and logic class naming system in WordPress theme developing?
- restrain filter on get_the_excerpt to queried item in stead of current post
- Why nav_menu_css_class doesn’t work with apply_filters?
- 3 Level Menu Navigation (3rd Level not displaying)
- WordPress wp_get_current_user returning blank values until refresh
- Alt header logo and link for specific pages
- overlay post title over post’s featured image
- Change site title color on individual pages
- How to fix an issue with customizer live preview?
- Hook in parent theme Menu function
- How do I remove p tag *insertions*? Disabling `wpautop` removes manual tags
- How to add custom nav_menu_css_class to certain menu only?
- Custom CSS no getting applied
- editor style css and page template with and without sidebar
- Enqueue Stylesheets After Theme’s “rtl.css”
- WordPress 3.5 + Foundation 5 not working on IE9
- Why the slideshow is not shown in my theme?
- Suppress the_content filter in a nested loop
- Any disadvandages if I style the wordpress align classes without img and .wp-caption prefix
- Custom link color or stylesheets
- Header is not showing full width
- How to highlight current menu bar base on the URL?
- What is The Best Way to Make Parallax header effect for wordpress theme ?? pure CSS or using JavaScript? [closed]
- Align images to the left of the content
- Image and font support missing in editor when deploying theme remotely