Jump to content


Photo
* * * * * 1 votes

Still New to DMS Child Themes - Get Started


Best Answer Danny , 21 February 2014 - 12:54 PM

@jmad

 

To my understanding, all that is required for a DMS child theme, the same goes for any Wordpress theme, is that the style.css file contains the following tag:

 

Template: dms <=== This should be the name of the theme you want to have as your parent. For example, you could have twentyfourteen etc...

Go to the full post


  • Please log in to reply
5 replies to this topic

#1 jmad

jmad

    Advocate

  • Members

  • 884 posts
  • LocationCentral Florida
  • Framework Version:DMS
  • Country: Country Flag

Posted 21 February 2014 - 02:26 AM

I've downloaded the DMS child theme that has Nick's name all over it with images and such.  I've substituted out the images and retitled the CSS page.  When I install my updated theme it works.  However, I think that I need to change some parts of the php.functions as nick's theme name is worked in throughout.  When I go in and sub a different name in the areas highlighted then and try to reactivate the theme it doesn't work.  

 

What else do I need to change?  Can we get a DMS branded child theme?  

 

<?php
 
// Load Framework - don't delete this
require_once( dirname(__FILE__) . '/setup.php' );
 
// Load our shit in a class cause we're awesome
class YourTheme {
 
function __construct() {
 
// Constants
$this->url = sprintf('%s', PL_CHILD_URL);
$this->dir = sprintf('/%s', PL_CHILD_DIR);
 
// Add a filter so we can build a few custom LESS vars
add_filter( 'pless_vars', array(&$this,'custom_less_vars'));
 
$this->init();
}
 
function init(){
 
// Run the theme options
$this->theme_options();
 
// Send the user to the Theme Config panel after they activate.
add_filter('pl_activate_url', array(&$this,'activation_url'));
}
 
// Send the user to the Theme Config panel after they activate. Note how link=nb_theme_config is the same name of the array settings. This must match.
function activation_url( $url ){
 
   $url = home_url() . '?tablink=theme&tabsublink=nb_theme_config';
   return $url;
}
 
// Custom LESS Vars
function custom_less_vars($less){
 
// Adding a custom LESS var, use this in LESS as @my-var. In this example, its linked to a custom color picker in options. We also must set a default or else it's going to error.
// pl_hashify must be used with color pickers so that it appends the # symbol to the hex code
// pl_setting is being used because this is a global option used in the theme
$less['my-var']   =  pl_setting('my_custom_color') ? pl_hashify(pl_setting('my_custom_color')) : '#07C';
 
return $less;
}
 
    // WELCOME MESSAGE - HTML content for the welcome/intro option field
function welcome(){
 
ob_start();
 
?><div style="font-size:12px;line-height:14px;color:#444;"><p><?php _e('You can have some custom text here.','nicks-base-theme');?></p></div><?php
 
return ob_get_clean();
}
 
// Theme Options
function theme_options(){
 
$options = array();
 
$options['nb_theme_config'] = array(
  'pos'                  => 50,
  'name'                 => __('Nicks Base Theme','nicks-base-theme'),
  'icon'                 => 'icon-rocket',
  'opts'                 => array(
  array(
         'type'        => 'template',
            'title'       => __('Welcome to My Theme','nicks-base-theme'),
            'template'    => $this->welcome()
      ),
      array(
          'type'         => 'color',
          'title'        => __('Sample Color','nicks-base-theme'),
          'key'          => 'my_custom_color',
          'label'        => __('Sample Color','nicks-base-theme'),
          'default'      =>'#FFFFFF'
      ),
  )
);
pl_add_theme_tab($options);
}
 
}
new YourTheme;


#2 James B

James B

    Advocate

  • Members

  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 21 February 2014 - 07:47 AM

Hi there, Nicks added a welcome panel to his base theme so there's some variables he's setup which are referenced in the code. Changing the name in places can break the theme if they're not all edited correctly.

 

I've just edited the basic code to give a simple PageLines generic child theme you can try out.

 

 

Attached Files


  • mtaus likes this

#3 jmad

jmad

    Advocate

  • Members

  • 884 posts
  • LocationCentral Florida
  • Framework Version:DMS
  • Country: Country Flag

Posted 21 February 2014 - 11:56 AM

@James B  

 

Thanks, I'll let you know how it goes.



#4 Danny

Danny

    Is Awesome!

  • Moderators
  • 16555 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 21 February 2014 - 12:54 PM   Best Answer

@jmad

 

To my understanding, all that is required for a DMS child theme, the same goes for any Wordpress theme, is that the style.css file contains the following tag:

 

Template: dms <=== This should be the name of the theme you want to have as your parent. For example, you could have twentyfourteen etc...



#5 jmad

jmad

    Advocate

  • Members

  • 884 posts
  • LocationCentral Florida
  • Framework Version:DMS
  • Country: Country Flag

Posted 21 February 2014 - 03:37 PM

Works great.

 

Thanks.



#6 Danny

Danny

    Is Awesome!

  • Moderators
  • 16555 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 21 February 2014 - 03:47 PM

No problem.