text 在Wordpres中添加自定义Jquery脚本

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text 在Wordpres中添加自定义Jquery脚本相关的知识,希望对你有一定的参考价值。

https://benfrain.com/how-to-easily-add-jquery-scripts-to-a-wordpress-child-theme/

Add @ functions.php of child theme:

if ( !is_admin() ) { // instruction to only load if it is not the admin area
    // register your script location, dependencies and version
    wp_register_script('custom_script',
        get_bloginfo('stylesheet_directory') . '/js/custom_script.js',
        array('jquery'),
        '1.0' );

    // enqueue the script
    wp_enqueue_script('custom_script');
}

Make sure to add jquery functions like the following template:

jQuery(document).ready(function($) {
    //$( "div.hero-search__content" ).replaceWith( "<h2>New heading</h2>" );
    $( ".hero-search__title" ).replaceWith( "<h2>New heading</h2>" );
});

以上是关于text 在Wordpres中添加自定义Jquery脚本的主要内容,如果未能解决你的问题,请参考以下文章

如何在 SwiftUI 中添加自定义容器视图

如何在 Flutter 中为 Text Widget 添加自定义删除线

R语言使用magick包的image_annotate函数在图片中添加文本标签信息自定义文本标签内容的位置色彩(Text annotations)

R语言ggplot2在可视化图像中添加横线并在横线中添加文本为横线中添加的文本添加文本框自定义文本框的填充色(background color for a text annotation)

text *模块* - 为客户添加自定义性别选项

text 如何添加自定义WIDGET