Applying a different style sheet to a page template

Community Forums Forums Design Tips and Tricks Applying a different style sheet to a page template

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  braddalton 1 year, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #65036

    Keithito
    Participant

    Hi there, I’m working on a landing page using Genesis with the Metro child theme, and I want to be able to apply a different css file to this page only.

    I have the landing page template working as page_landing.php, and I have it set to remove the typical sidebar/header content, but I’m not sure how to go about attaching a new style sheet to just this page. I may be missing something super simple here.

    Thanks!

    #65176

    braddalton
    Participant
    Post count: 10674

    You don’t need to because you can simply use a custom body class.

    Change the name in the file to something like custom-landing.
    [php]
    <?php
    /**
    * This file adds the Landing template to your Theme.
    *
    * @author StudioPress
    * @package Lifestyle Pro
    * @subpackage Customizations
    */

    /*
    Template Name: Custo Landing
    */

    //* Add custom body class to the head
    add_filter( ‘body_class’, ‘lifestyle_add_body_class’ );
    function lifestyle_add_body_class( $classes ) {

    $classes[] = ‘custom-landing';
    return $classes;

    }

    //* Force full width content layout
    add_filter( ‘genesis_pre_get_option_site_layout’, ‘__genesis_return_full_width_content’ );

    //* Remove site header elements
    remove_action( ‘genesis_header’, ‘genesis_header_markup_open’, 5 );
    remove_action( ‘genesis_header’, ‘genesis_do_header’ );
    remove_action( ‘genesis_header’, ‘genesis_header_markup_close’, 15 );

    //* Remove navigation
    remove_action( ‘genesis_before_header’, ‘genesis_do_nav’ );
    remove_action( ‘genesis_after_header’, ‘genesis_do_subnav’ );

    //* Remove breadcrumbs
    remove_action( ‘genesis_before_loop’, ‘genesis_do_breadcrumbs’ );

    //* Remove site footer widgets
    remove_action( ‘genesis_before_footer’, ‘genesis_footer_widget_areas’ );

    //* Remove site footer elements
    remove_action( ‘genesis_footer’, ‘genesis_footer_markup_open’, 5 );
    remove_action( ‘genesis_footer’, ‘genesis_do_footer’ );
    remove_action( ‘genesis_footer’, ‘genesis_footer_markup_close’, 15 );

    //* Run the Genesis loop
    genesis();
    [/php]

    Or you can try this tutorial http://wpsites.net/wordpress-themes/second-style-sheet-theme/

    Example:

    https://gist.github.com/braddalton/5734973


Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.