Why not just add the class directly to the tag?
<html <?php language_attributes(); ?> class="page-id-<?php the_ID(); ?>">
Related Posts:
- ajax live search for post title
- Wrap gutenberg block ‘div’ in other elements/extra HTML
- Remove tag on my RSS Feed
- get_the_excerpt() not returning anything when post has no excerpt
- Automatically add author’s name to post_tag
- Pinterest Integration Using functions.php
- Why isn’t is_page_template() adding a body class?
- radio button is checked but display not check
- Adding a class to tag list in a function
- How can you limit srcset on a single type of page?
- Create single.php for specific tag by tag id or name
- list tags with count in author profile page
- Product Tags in Add New product as checkbox list [closed]
- Retrieve tags data in post body
- Echo tags used to describe the theme
- Using Schema with `the_excerpt`
- Frontend tag edit/submit form
- Scripts not appending to element in AJAX call – why?
- WordPress Menuing Question :focus
- Is possible add icon in title posts only in specific tag?
- Remove after images
- Warning: : DOMDocument::loadHTML(): Empty string supplied as input in functions.php when adding classes to post images
- PHP mixed with some JS code to update WordPress theme settings
- Display tags that only appear in one category
- Make wp_link_pages() suitable for Twitter Bootstrap markup
- Need to put a script above tag in header.php – WP 5.7.1
- How to edit the Tags within the image file URLs?
- echo custom fields with AJAX
- Function filter breaking tag archive menus
- Tags break custom Excerpt function
- Numbering lines of code with the tag?
- Randomizing wp_tag_cloud() in child theme
- The correct way to add a JavaScript in the functions.php [closed]
- Auto scroll to id on page load on all pages except home page. Only do this on mobile
- Adding theme option values as custom body class
- Sort and display pages with specific custom field (not tag)
- Creating multiple category drop down
- Function to echo (or display?) wordpress tags in the head section
- Shortcode of a function
- What is wp_get_post_tags for media tags?
- how to check if an element in an html file exists in another html file? [closed]
- Allow user only create specific tags
- How do I make a custom “Read More Blogs” button for my blog page
- Adding Custom Body Class for Page: Shop
- Images with overlay
- Removing sanitize_title_with_dashes Function with The Real Title
- Add schema to Search result page’s body. Tried using is_search
- method to fetch entire tag list on archive.php
- require_once() Causing categories and tag pages on dashboard to not refrsh
- Change post count on tag/terms pages to 10
- Show all posts from the tags without having to set all of them
- different body classes for each category
- Some code is added automatically to my site’s header – what is it?
- Automatic add space if user enters number(any digit)
- How to list out all values from the get_body_class array
- Custom taxonomy not refreshing page on add
- Automatically add tag if a checkbox is checked
- getExcerpt: Make ellipsis appear only if character limit is reached
- Sanitize html, where to sanitize
- Remove heading tags on line break
- Make WordPress search for only this tags or exclude certain tags from search [duplicate]
- How to get tags and categories?
- If two tags in the middle i need comma
- Display function from functions.php in tag.php
- Bulk set Post Title as Tag where Tag is Empty Function
- Can’t find function which is called in a wordpress theme
- Function to filter numbers from string
- What is the difference between HTML tags and ?
- Adding attribute in jQuery
- Stray end tag “head”
- Missing feature image link function
- What’s the difference between home_url() and site_url()
- Remove “Category:”, “Tag:”, “Author:” from the_archive_title
- get_template_directory_uri pointing to parent theme not child theme
- How to customize the_archive_title()?
- remove empty paragraphs from the_content?
- What is the “with_front” rewrite key?
- Why use if function_exists?
- How to override parent functions in child themes?
- wp_enqueue_script was called incorrectly
- Add multiple custom fields to the general settings page
- Ajax call always returns 0
- 400 bad request on admin-ajax.php only using wp_enqueue_scripts action hook
- How long does a deprecated function live in core?
- Solution to render Shortcodes in Admin Editor
- How to add a data attribute to a WordPress menu item
- What’s the difference between esc_html, esc_attr, esc_html_e, and so on?
- remove_action on after_setup_theme not working from child theme
- plugins_url vs plugin_dir_url
- Remove type attribute from script and style tags added by WordPress
- How to run a function every 5 minutes?
- Best way of passing PHP variable between partials?
- Upload Multiple Files With media_handle_upload
- How to display custom field in woocommerce orders in admin panel?
- Adding fields to the “Add New User” screen in the dashboard
- Issues with title-tag and document_title_parts
- How do I get the current edit page ID in the admin?
- How to check if a user exists by a given id
- Why isn’t is_page working when I put it in the functions.php file?
- Add tags to the section via functions.php