• Resolved jakaria5482

    (@jakaria5482)


    Hello,
    I’m using a custom-made theme. I want to write CSS for specific page. So that I want to add class or ID in body tag. But since I’m using a custom-made theme, the CSS classes are the same for all pages. I want to add custom CSS class or ID in specific page in body, so that I can write CSS.
    If anyone helps me.

    • This topic was modified 2 years, 9 months ago by jakaria5482.
Viewing 2 replies - 1 through 2 (of 2 total)
  • But since I’m using a custom-made theme, the CSS classes are the same for all pages.

    Why should using a custom-made theme limit you to the same CSS classes for all pages?

    It just means you’re not following following WordPress’ coding standards and not using the appropriate built-in functions.

    Add the body_class() function to your body HTML tag for WordPress to generate various body classes (including a unique class with the ID of the individual page/post).

    https://developer.www.ads-software.com/reference/functions/body_class/

    Thread Starter jakaria5482

    (@jakaria5482)

    Actually, I haven’t made the theme. I’m using the theme.

    Thank you so much for your help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How can I add Custom Class or ID in wordpress?’ is closed to new replies.