• 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

Styling Category Pages in News-Pro2

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 › Styling Category Pages in News-Pro2

This topic is: not resolved

Tagged: categories, styles, styling, template

  • This topic has 3 replies, 2 voices, and was last updated 9 years, 8 months ago by Victor Font.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • May 2, 2016 at 4:58 am #184789
    achuka
    Participant

    I am setting up some page templates to display different types of book posts and want to link to a different custom.css for each template (so that I can style each section of the site independently), but so far I am having trouble overriding the call to the default style.css in the child theme (tweaked from the parent StudioPress theme).

    I have been trying variations on...
    <link rel=”stylesheet” type=”text/css” href=”yourdomain.com/wp-content/themes/your-theme/custom.css” media=”all”/>
    added to the category-specific page template...

    Any advice / examples will be very gratefully received!

    http://www.achuka.co.uk/blog
    May 2, 2016 at 5:39 am #184794
    Victor Font
    Moderator

    There are a few ways to add custom page-level style sheets. While you can use a link to connect to a style sheet, the correct way to do this in WordPress is with wp_enqueue_style. Look in your theme's functions.php for the function that loads the style sheet. If you wrap the style sheet load in a conditional:

    if (is_page('999') ) {
        wp_enqueue_style(...custom_style_sheet);
    } else {
        wp_enqueue_style(...normal_style_sheet);
    }

    Or, you can enqueue the style sheet directly in the page templates you are creating.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    May 2, 2016 at 6:42 am #184797
    achuka
    Participant

    Thanks Victor.

    In this (News Pro) theme, the regular stylesheet is not called directly by functions.php

    Rather, functions.php invokes lib/init.php from the parent Genesis folder

    containing the line
    //* Load CSS
    require_once( GENESIS_CSS_DIR . '/load-styles.php' );

    For obvious reasons I'm reluctant to make any changes to the parent Genesis theme and only want to customise the child theme...

    I'll try adding the enqueue coding suggested above the functions.php file and see if it has an effect...

    Michael

    May 3, 2016 at 5:41 am #184890
    Victor Font
    Moderator

    In that case, it's a little easier. This is what you use:

    add_action( 'wp_enqueue_scripts', 'load_page_style' );
    function load_page_style() {
        if ( is_page('999') ) {
            remove_action( 'genesis_meta', 'genesis_load_stylesheet' );
            wp_enqueue_style(...custom_style_sheet);
        }
    }

    What this does is remove the main genesis style sheet and load the custom style sheet for the page with ID 999. Of course you have to change the page ID or use an array of page id numbers.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 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

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