WordPress.org

Ready to get started?Download WordPress

Forums

alternative to child themes? (6 posts)

  1. peteratomic
    Member
    Posted 3 years ago #

    Essentially, I want to be able to assign a child theme to a specific page. Doesn't seem possible, since you can only have one active template at a time. So I tried creating a new template file...

    Problem is that I want this new template to use a DIFFERENT stylesheet (so I can change out the graphics). I created a template and changed the code to get a different header file:

    get_header(); ?>

    Which I replaced with get_header2(); ?>

    But that didn't work. Obviously there is other code in the system that doesn't allow for variations in names of the header file.

    Any other workarounds?

  2. alchymyth
    Forum Moderator
    Posted 3 years ago #

    there is a lot of info in the codex - for instance:

    http://codex.wordpress.org/Function_Reference/get_header

  3. Simon Prosser
    Theme Review Admin
    Posted 3 years ago #

    if you use wp_enqueue_style to load the css file, you can use a conditional ..

  4. peteratomic
    Member
    Posted 3 years ago #

    Hi Alchymyth,

    That page you gave me looks like it will have the answer, but unfortunately it's written for programmers and assumes one understands a lot (many details missing from that page... probably included elsewhere). If I read it correctly, it seems that all I need to do is change

    <?php get_header(); ?>

    to this:

    get_header($alt); ?>

    Whereas my header file is called: header-alt.php. Unfortunately, it doesn't work -- it's still bringing up the original header.php file.

    Also tried using this:

    <?php
    if ( is_fullpage() ) :
    get_header('alt');
    else :
    get_header();
    endif;
    ?>

    But no luck. Any ideas?

  5. alchymyth
    Forum Moderator
    Posted 3 years ago #

    you could either use:

    get_header('2');
    and create a file
    header-2.php

    or for

    get_header('alt');
    you would use the file
    header-alt.php

  6. peteratomic
    Member
    Posted 3 years ago #

    perfect! worked like a charm!

Topic Closed

This topic has been closed to new replies.

About this Topic