0
ちょっと、私は自分のワードプレスのブログにタブ付きメニューを作成しました。私は親のテーマでそれをやった。今、私はその親テーマの子テーマを作成しました。すべてのものは、タブ付きのメニューを期待しているようです。私はタブ付きメニューのためにjQueryを使いました。 ここに私のfunction.php
ファイルの特定の部分は、親のテーマからjQueryとCSSコードを含めることです。子テーマは親テーマのjQueryコードをワードプレスで取得していません。
// enqueue tabs script
function my_scripts_tabs() {
if (!is_admin()) {
wp_enqueue_script('jquery-ui-tabs');
wp_enqueue_script('custom-tabs', get_stylesheet_directory_uri() .
'/js/tabs.js', array('jquery'));
}
}
add_action('wp_enqueue_scripts', 'my_scripts_tabs');
//add tabs stylesheet
wp_register_style('jquery-custom-style',
get_stylesheet_directory_uri().'/css/jquery-ui-1.12.1.custom/jquery-ui.css',
array(), '1', 'screen');
wp_enqueue_style('jquery-custom-style');
ここは私のfunction.phpファイルです。
<?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_parent_css')):
function chld_thm_cfg_parent_css() {
wp_enqueue_style('chld_thm_cfg_parent', trailingslashit(
get_template_directory_uri()) . 'style.css', array('genericons'));
}
endif;
add_action('wp_enqueue_scripts', 'chld_thm_cfg_parent_css', 10);
// END ENQUEUE PARENT ACTION
誰でも手伝ってください。 TIA