• 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

Adding CSS HTML Class to CPT Archives for Attributes Order

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 › Adding CSS HTML Class to CPT Archives for Attributes Order

This topic is: not resolved

Tagged: archive template, css classes, custom post types, order

  • This topic has 1 reply, 2 voices, and was last updated 10 years, 7 months ago by Tom.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • October 7, 2014 at 12:08 pm #127006
    Scott Buehler
    Member

    I'm trying to find a functions.php code that will print the "Attributes" Order number I assign to a custom post type or page to the article HTML classes I can then style with CSS.

    
    <article itemtype="http://schema.org/CreativeWork" itemscope="itemscope"
    class="post-39 custom-post-type-example type-custom-post-type-example status-publish format-standard entry odd">
    

    If I assign Attribute Order: 2 to a custom post type, how can I get that order number printed in the article class=""

    If I assign Order: 4
    Print: rank4 in css class.

    Anyone have experience with this? I could take my CPT archive pages to the next level if I could do something like this.

    If I had the css class to style, I could do all sorts of fun things in CSS!!


    TygrScott on Social Media

    October 13, 2014 at 1:44 pm #127696
    Tom
    Participant

    You can add custom classes to pages and posts - CPT included - by using the "Layout Settings" in the post editor,
    Layout Settings panel

    A Custom Body Class allows you to style the post itself; a Custom Post Class allows you to style the post output in an archive, etc.


    Choose your next site design from over 350 Genesis themes.
    [ Follow me: Twitter ] [ Follow Themes: Twitter ] [ My Favourite Webhost ]

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and 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