Jump to content

Archived

This topic is now archived and is closed to further replies.

jmad

Still New to DMS Child Themes - Get Started

Recommended Posts

jmad+    80
jmad

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;

Share this post


Link to post
Share on other sites
James B    436
James B

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.

 

 

  • Like 1

Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
jmad+    80
jmad

James B  

 

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

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

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...


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
jmad+    80
jmad

Works great.

 

Thanks.

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

No problem.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

×