• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

How to add a custom class

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › How to add a custom class

This topic is: resolved
  • This topic has 7 replies, 2 voices, and was last updated 12 years, 5 months ago by Jen Baumann.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • December 10, 2012 at 9:51 am #4181
    DigitalC
    Member

    I need to add a custom class to my entry-content div in the html. Can someone help me figure out how to do that? Thanks!

    December 10, 2012 at 11:35 am #4197
    Jen Baumann
    Participant

    Can you explain more what you are trying to accomplish?  Depending on what you are doing, you probably don't need to add a class to the entry-content div and can either use existing body or post classes.

    December 10, 2012 at 12:01 pm #4205
    DigitalC
    Member

    I installed a plugin called "Print Friendly and PDF" and I'm having a problem where it is only selecting some of the content on my page to print. Their support response was that I had to add a class called print-friendly to my entry-content div. So that's what I was trying to do. If there's an easier way, I'm all for it.

    December 10, 2012 at 12:26 pm #4220
    Jen Baumann
    Participant

    I found your post here: http://wordpress.org/support/topic/missing-content-in-print-friendly-page

    It is probably better to add a post class.

    add_filter('post_class', 'additional_classes');
    function additional_classes($classes) {
    $classes[] = 'myclass';
    return $classes;
    }

    December 10, 2012 at 12:49 pm #4226
    DigitalC
    Member

    And that would go in the functions file?

    December 10, 2012 at 12:54 pm #4230
    Jen Baumann
    Participant

    Yes, it would :0)

    December 19, 2012 at 8:51 pm #6301
    DigitalC
    Member

    Hey, sorry for the delay, just wanted to let you know that worked and got me where I wanted to be! Thanks so much for your help.

    December 19, 2012 at 8:57 pm #6302
    Jen Baumann
    Participant

    Glad that worked! You're very welcome!

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘How to add a custom class’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble