Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

Kadence Child Theme

Home / Forums / Pinnacle Theme / Kadence Child Theme

This topic is: Not Resolved
[Not Resolved]
Posted in: Pinnacle Theme
March 7, 2016 at 12:54 pm

I need to modify functions.php to change the wpml language switcher behavior. I believe that I’ll need to use a child theme so that future pinnacle premium updates don’t overwrite my modifications.

I reviewed the Kadence documentation, created new style.css and function.php files, and uploaded them to a new pinnacle-premium-child directory. I must of missed something, because I white screen came up when I went into Live Preview mode. My style.css and functions.php are below.

Was I supposed to do something different with styles.css? The wordpress documentation indicates that another step is required for the style sheet. It states that the correct method of enqueuing the parent theme stylesheet is to add a wp_enqueue_scripts action and use wp_enqueue_style() in your child theme’s functions.php.

Style.css
/*
Theme Name: pinnacle premium child
Theme URI:
Description: pinnacle premium child theme
Author: Dean Hill
Author URI:
Template: pinnacle_premium
Version: 1.0.0
License: GNU General Public License v2 or later
License URI:
Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
Text Domain: pinnacle_premium_child
*/

functions.php
<?php // Opening PHP tag - nothing should be before this, not even whitespace
/*
* Custom Language Switcher Code - makes inactive language display instead
* of active
*/
function new_nav_menu_items($items,$args) {
if (function_exists('icl_get_languages')) {
$languages = icl_get_languages('skip_missing=0');
if(1 < count($languages)){
foreach($languages as $l){
if(!$l['active']){
$items = $items.'<li class="menu-item"><a href="'.$l['url'].'">'.$l['native_name'].'</a></li>';
}
}
}
}
return $items;
}
add_filter( 'wp_nav_menu_items', 'new_nav_menu_items',10,2 );

  • The forum ‘Pinnacle Theme’ is closed to new topics and replies.