• Resolved akintern

    (@akintern)


    Hi,

    Is it possible to create page templates that uses a different skin from the main theme. In a real world scenario:
    Whenever I create a page, I can select “Red Template” or “Green Template” which will use the red skin or green skin of the Customizr theme respectively.

    Sorry if my terms are incorrect.
    Thank you in advance.
    -Jenny

Viewing 5 replies - 1 through 5 (of 5 total)
  • For example, you can add a custom field in your pages/posts named “skin” and set it to blue or blue3 or red.. etc.
    then add this to your child-theme functions.php:

    add_filter('tc_get_option', 'my_skin', 20, 2);
    function my_skin($value, $option){
        if ( $option != 'tc_skin' )
            return $value;
        global $post;
        if ( isset($post) && $skin=get_post_meta($post->ID, 'skin', 'true')){
            return $skin.'.css';
        }
        return $value;
    }

    and you’ll have it.

    Thread Starter akintern

    (@akintern)

    The code worked! Thank you so much for your help again d4z_c0nf!

    -Jenny

    I need this functionality as well.

    I have added this code into customizr pro child themes function.php but how do I add a custom field in the pages/posts named “skin” and set it to blue or blue3 or green or red?

    Thanks!

    Hi,
    in the upcoming version of the theme that code must be replaced with this:

    /*
    * Code to select skin type
    */
    add_filter('tc_opt_tc_skin', 'my_skin', 20 );
    function my_skin($value){
      global $post;
      if ( isset($post) && $skin=get_post_meta($post->ID, 'skin', 'true')){
        return $skin.'.css';
      }
      return $value;
    }

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Is it possible to create page templates that uses different style sheet/skin?’ is closed to new replies.