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
- Upload Multiple Files With media_handle_upload
- What is the difference between get_page_link and get_permalink functions?
- mysql custom wp query
- TinyMCE custom stylesheets for different post types
- Order get_users() by last login date. Is it possible?
- Display random text from a file with the WP built-in AJAX API
- How to call a function on particular page like ‘contact-us’ from function.php of child theme
- Detect Safari desktop browser and include the detection in a shortcode
- Is It wrong to use oop approach on functions.php?
- How to preserve edits to Name or Slug of term when using wp_update_term on save?
- Where do I add html code to the menu div?
- Add function to every post?
- Understanding and altering the structure of posted images
- How do I hide or remove ‘Category’ from wordpress breadcrumbs
- Trouble with adding a wp_enqueue_script on wordpress
- Display ‘BuddyPress Follow’ follow button to non-logged in users [closed]
- Load custom css in functions.php causing library issue
- In jquery use php variable to execute an enqueued jquery file
- Run a jquery script on on a certain template page
- Can’t add_action to ‘save_post’ and get it to fire
- How to load jQuery in TOP of wp_footer?
- How to fetch custom post type by variable date?
- How do I register a new settings page? [closed]
- Display ACF category image on archive and single template files
- Auto delete content in specific folder inside media library
- Using get_terms for custom taxonomy in functions.php
- How to update an image attachment’s alt text from a custom field when saving a post?
- Child theme remove parent filter in functions
- Replace Tag Keyword With Link Within Post Content
- How to add publish/draft button in Admin Post Lists
- How to add number to wordpress count function?
- How do I integrate my Child Theme into a Custom Template?
- Why are some custom javascript files working but some are not
- using enqueue_script in a shortcode isn’t working