Child theme functions.php is not executing

WordPress + WooCoomerce + Storefront theme + Storefront child theme.

I have the child theme’s functions.php file from previous site development iteration which used to work. After migrating to new hosting I set up from the scratch same set of WordPress + WooCoomerce + Storefront theme + made Storefront child theme. The only diference with previous iteration is set of plug-ins and CSS rules/styling but custom code in functions.php is not touching them at all. Hoever then I copied functions.php from the previous site iteration it seems to be not executed at all. Trying to fix that I plaied a bit with file permissions on OS level: now it is set to rwxrwxrwx (I know it is not safe but I totaly run out of ideas of what is happening)

What might be going wrong with functions.php?

Here goes the functions.php contents

<?php // Exit if accessed directly if ( !defined( 'ABSPATH' ) ) exit;   // BEGIN ENQUEUE PARENT ACTION // AUTO GENERATED - Do not modify or remove comment markers above or below:  if ( !function_exists( 'chld_thm_cfg_locale_css' ) ):     function chld_thm_cfg_locale_css( $  uri ){         if ( empty( $  uri ) && is_rtl() && file_exists( get_template_directory() . '/rtl.css' ) )             $  uri = get_template_directory_uri() . '/rtl.css';         return $  uri;     } endif; add_filter( 'locale_stylesheet_uri', 'chld_thm_cfg_locale_css' );           if ( !function_exists( 'child_theme_configurator_css' ) ):     function child_theme_configurator_css() {         wp_enqueue_style( 'chld_thm_cfg_separate', trailingslashit( get_stylesheet_directory_uri() ) . 'ctc-style.css', array( 'storefront-gutenberg-blocks','storefront-style','storefront-style','storefront-icons','storefront-jetpack-widgets','storefront-woocommerce-style' ) );     } endif; add_action( 'wp_enqueue_scripts', 'child_theme_configurator_css', 30 );  // END ENQUEUE PARENT ACTION   add_filter( 'storefront_credit_link', '__return_false' );   add_filter( 'woocommerce_variable_price_html', 'variation_price', 20, 2 );  function variation_price( $  price, $  product ) {       $  min_regular_price = $  product->get_variation_regular_price( 'min', true );     $  min_sale_price = $  product->get_variation_sale_price( 'min', true );     $  max_regular_price = $  product->get_variation_regular_price( 'max', true );     $  max_sale_price = $  product->get_variation_sale_price( 'max', true );       if ( ! ( $  min_regular_price == $  max_regular_price && $  min_sale_price == $  max_sale_price ) ) {         if ( $  min_sale_price < $  min_regular_price ) {             $  price = sprintf( '<span>from </span><del>%1$  s</del><ins>%2$  s</ins>', wc_price( $  min_regular_price ), wc_price( $  min_sale_price ) );         } else {             $  price = sprintf( '<span>from </span>%1$  s', wc_price( $  min_regular_price ) );         }     }       return $  price;   }   function short_woocommerce_product_titles_words( $  title, $  id ) {   if ( ( is_shop() || is_product_tag() || is_product_category() ) && get_post_type( $  id ) === 'product' ) {     $  title_words = explode(" ", $  title);     if ( count($  title_words) > 6 ) { // Kicks in if the product title is longer than 6 words       // Shortens the title to 6 words and adds ellipsis at the end       return implode(" ", array_slice($  title_words, 0, 6)) . '...';     } else {       return $  title; // If the title isn't longer than 6 words, it will be returned in its full length without the ellipsis     }   } else {     return $  title;   } } add_filter( 'the_title', 'short_woocommerce_product_titles_words', 10, 2 );   remove_action( 'storefront_header', 'storefront_product_search', 40); add_action( 'storefront_header', 'storefront_product_search', 25 ); 

filter default wp_query to show just selected level of child pages in wordpress

I’m working on a site that has a fairly large page structure a few levels deep – in some sections there are a lot of pages.

So I want to have functionality if user choose on select box level 1 then only pages in level 1 will show in below list of pages. if he choose level 2 then only level 2 pages, same go to level 3 level 4 level 5 level 6.

it’s working for top level parent pages when I set query_vars[‘post_parent’] = 0; and I want to have same functionality to show list of level 1 child page,level 2 child pages and so on…

I am stuck on it. please I will be great full if anyone can help me for it. Thanks see screenshot link

function level_page_admin_posts_filter( $  query ) {   global $  pagenow;   if ( is_admin() && $  pagenow == 'edit.php' && !empty($  _GET['lavel_pages'])) {       $  level = $  _GET['lavel_pages'];       if($  level == 'parent'){         $  query->query_vars['post_parent'] = 0;       }else        if($  level == 1){                }else       if($  level == 2){        }   } } add_filter( 'parse_query', 'level_page_admin_posts_filter' );  function admin_page_filter_level_pages() {   global $  wpdb;   if (isset($  _GET['post_type']) && $  _GET['post_type'] == 'page') {   $  sql = "SELECT ID, post_title FROM ".$  wpdb->posts." WHERE post_type = 'page' AND post_parent = 0 AND post_status = 'publish' ORDER BY post_title";   $  parent_pages = $  wpdb->get_results($  sql, OBJECT_K);   $  select = '     <select name="lavel_pages">       <option value="parent">Parent Pages</option>       <option value="1">Level 1</option>       <option value="2">Level 2</option>       <option value="3">Level 3</option>       <option value="4">Level 4</option>       ';      $  select .= ' </select>';   echo $  select; } else {   return; } } add_action( 'restrict_manage_posts', 'admin_page_filter_level_pages' ); 

How would I go about replacing this function in my child theme located in inc/template-tags.php

How would I replace this function that lies inside inc/template-tags.php in my parent theme

function theme_navigation() { ?>                  <div id="theme-nav-container">             <nav id="site-navigation" class="main-navigation">                 <?php wp_nav_menu( array('theme_location' => 'theme-studios-primary', 'menu_class' => 'sf-menu', 'fallback_cb' => false, 'walker'  => new theme ) ); ?><div class="clearfix-pro"></div>             </nav>             <div class="clearfix-pro"></div>         </div>                  <!-- close #theme-nav-container -->                   <?php } 

There is no add action that it is hooked on to, there is no check to see if the function already exists. How would I replace it without touching the parent theme. I have removed much of the code in the function for brevity but I think it still makes sense.

Thanks ahead of time

Randomizing wp_tag_cloud() in child theme

I’m trying to write a wordpress function code in my child theme that randomizes the words in the word cloud where previously it was alphabetized.

The code Im using is below, which doesn’t work.

// add_filter('wp_tag_cloud_args', 'my_wp_tag_cloud_args_filter'); function my_wp_nav_menu_args_filter($  args) {     $  args['order'] = 'RAND';     // do something     return $  args; } // 

I’m able to update the wp_tag_cloud()’s default (‘Order’ = ‘RAND’) args in wp-includes/category-template.php but I know that any changes will get replaced. The change work when in that file.

How can I move those set of changes to my wordpress child theme?

Child theme stylesheet not reflecting the changes

I have created a child theme and the website is showing up properly with the activated child theme. I made some changes in the child theme’s php files for adding two controls in the child theme’s Appearance –> Customize section which will add a button ("Download my cv" button) on the home page. To do this I have added two php files and made modifications in them, keeping the same folder structure as the parent theme. They are working perfectly locally but not on the server. Although in localhost I have made the changes directly on the parent theme files.

I also can see the child theme’s style sheet is loading by view source but on making modification in the style sheet its not showing the changes. Whereas any modification in functions.php is working. Some help would be appreciated. Please check the screenshots. Thanks changes in localhost on parent theme working fine but changes in the child theme on server not working

How to change only one javascript function in wordpress child theme?

I would like to change just one JavaScript function in the child theme but without having to insert all the JavaScript code of the parent theme.

How do I change only this function (I need change only count = Math.ceil(width / size) line):

function slickAutoResponsive(slider, max, size) {    if (!max){     max = 5;   }   if (!size){     size = 380;   }    var width = slider.width(),     count = Math.ceil(width / size);    if (count < 1) count = 1;   if (count > max) count = max;    return count; } 

How to make child object a member of two parents in unity?

So I have an parent game object that has multiple objects.

This format is desirable:

-GameObject     -object1 (abstract)         -subobject1      -object2 (abstract)         -subobject2      -object3 (abstract)         -subobject1         -subobject2 // There are two objects in the scene, subobject1 and subobject2 

The problem is when i drag and drop one subobject from an object it removes it from the other object. When i copy the subobjects to another object, there are now two.

I hope this makes sense.

twentysixteen child theme – responsive menu – ham icon button not working – Cannot read property ‘classList’ of null

I am trying to convert this site into twentysixteen child theme. It appears that /js/menu.js in my child theme is not working as nothing happens when the ham icon button is clicked (pls.see my site link above to check correct behavior). On inspecting via Google Chrome Inspect I am getting the following errors:

Uncaught TypeError: Cannot read property ‘classList’ of null at mediaqueryresponse (menu.js?ver=5.3.2:19) at menu.js?ver=5.3.2:10 at menu.js?ver=5.3.2:31 mediaqueryresponse @ menu.js?ver=5.3.2:19 (anonymous) @ menu.js?ver=5.3.2:10 (anonymous) @ menu.js?ver=5.3.2:31

Any advice is appreciated

header.php in child theme

<header class="header" id='myTopnav'>  <?php  wp_nav_menu(              array(                   'theme_location'=> 'topnav',                   'container' => 'nav',                   'menu_class' => 'topnav',                   'menu_id'    => 'myTopnav',                   )  );?>  <button class="ham-icon"><span class="fa fa-bars fa-2x"></span></button>  </header> 

/js/menu.js in child theme

(function () {   var mql = window.matchMedia("screen and (max-width: 960px)");   //detect media query    var navTop = document.querySelector(".header");   //return first element within the document that matches .header    var toggle = document.querySelector(".ham-icon");    mediaqueryresponse(mql);   //ensures that addListener function is executed when the page loads, by default addListener only fires when state of the window changes   mql.addListener(mediaqueryresponse);    function mediaqueryresponse(mql) {     if (mql.matches) {       toggle.addEventListener("click", clickMenu);       //if media query matches, execute click or clickMenu event     } else {       navTop.classList.remove("responsive");       //otherwise remove .responsive       toggle.removeEventListener("click", clickMenu);       //and remove EventListener     }    }    function clickMenu() {     navTop.classList.toggle("responsive");   }  })(); 

finding the parent index in an interval heap (stored on an array) given a child index

an interval heap is a binary tree stored on an array where the size of each node is 2.

i would like to be able to find the index of a parent and find one of the child indices given the index of a node.

an example of an interval trees indices would be:

         [0,1]      [2,3]     [4,5]  [6,7][8,9][10,11][12,13] 


         [1,2]      [3,4]     [5,6]  [7,8][9,10][11,12][13,14]