Parent category as WOOCommerce Categories widget title

Try this it works for me. Place this code in your theme functions.php file. function dynamic_product_category_widget($title, $widet_instance, $widget_id) { if ( $widget_id !== ‘woocommerce_product_categories’ ) return $title; if ( is_product_category() ) { $cat_title = single_cat_title(‘<p class=”widget-title footer-widget”>’, ‘</p>’); return $cat_title; } elseif ( is_product() ) { $cat = get_the_terms( $product->ID, ‘product_cat’ ); foreach ($cat as … Read more

Can site visitors view functions.php file?

It’s always difficult to prove that something isn’t there, like the famous teapot circling the earth. So you’ll have to trust me that the WordPress source code does not have any functions that might display its own php files. That said, it would be easy to write such code. So, if you install plugins of … Read more

How to add javascript code into Divi child theme?

You’re almost there, change code in functions.php to: <?php function my_theme_enqueue_styles() { $parent_style=”divi-style”; wp_enqueue_style( $parent_style, get_template_directory_uri() . ‘/style.css’ ); wp_enqueue_style( ‘child-style’, get_stylesheet_directory_uri() . ‘/style.css’, array( $parent_style ), wp_get_theme()->get(‘Version’) ); wp_enqueue_script( ‘et_mobile_nav_menu’, get_stylesheet_directory_uri() . ‘/js/selectpage.js’, array( ‘jquery’ ), true ); } add_action( ‘wp_enqueue_scripts’, ‘my_theme_enqueue_styles’ ); ?> Now your script should be located at: /wp-content/themes/divi-child/js/selectpage.js