• 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

Change background based on category

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 › General Discussion › Change background based on category

This topic is: not resolved

Tagged: custom background

  • This topic has 6 replies, 4 voices, and was last updated 5 years, 7 months ago by Brad Dalton.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • August 16, 2017 at 10:10 am #210467
    KenSP
    Member

    How can I change the background on a post based on the category of the post? I am using Executive Pro.
    I.E. - I have a series of post topics in Category1, another series of post topics in Category2.
    All topics in Category1 are to have Cat1.jpg for the background, all topics in Category2 are to have Cat2.jpg for the background.

    Thanks - Ken

    http://local
    August 16, 2017 at 1:01 pm #210475
    Brad Dalton
    Participant

    Try the custom-background-extended plugin


    Tutorials for StudioPress Themes.

    August 17, 2017 at 1:50 pm #210494
    Brad Dalton
    Participant

    Ken. Where you referring to the use of a background image or background color?


    Tutorials for StudioPress Themes.

    August 17, 2017 at 2:43 pm #210495
    aykt
    Member

    You can define the CSS for the category class you're targeting in the style.css file. You'll set your background image or colors in that class and then use that class in either the 'Custom Body Class' or 'Custom Post Class.'

    If you're wanting to do it via functions.php you can write your own function that use a combination of the 'body_class' filter and is_category to change the background without using the custom body/post classes in the post options.

    August 17, 2017 at 3:03 pm #210497
    KenSP
    Member

    Wanting to use an image. However, as the content may cover the image I may have to change the color.

    The Custom Background Extended plugin you referenced may do what I want - will try it out in the next couple of days and post what happened.

    Thanks - Ken

    August 21, 2017 at 5:53 am #210577
    pubg
    Member

    Hey Ken, that's awesome idea, could increase a lot sale conversions!


    http://battlegroundsarmory.com/

    August 21, 2017 at 3:29 pm #210596
    Brad Dalton
    Participant

    Or, you can use custom code which does this


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘General Discussion’ 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

© 2023 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