php - How to locate parent theme functions and add functions to my wordpress child theme?

I am using a wordpress child theme and have added css code to the style.css and everything works well. When i want to ad

I am using a wordpress child theme and have added css code to the style.css and everything works well. When i want to add function to my function.php file I always get error message. I am new to using the child theme so my problem is to know where to place functions. Should all new functions be placed inside funtion.php or does it depend on each function.

function.php file:

<?php
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {

    $parent_style = 'PRANAYAMA_YOGA_THEME_VERSION'; // 

    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')
    );
}

For example i tried to add a onepage-nav function to my Menu, like this

  $('#nav').onePageNav({
    currentClass: 'current',
    changeHash: false,
    scrollSpeed: 750
  });
 /

But my site crashed.

Thanks in Advance

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745249178a4618572.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信