Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #720592

    Hello, I am new to Enfold and almost new to WP (building my fourth WP site now). I have downloaded the Child Theme and installled it succesfully. But I have some questions:

    – why is it not necessary to enqueue the parent and child theme stylesheets as described in the WP codex and ad code to the functions.php file like this:

    <?php
    add_action( ‘wp_enqueue_scripts’, ‘my_theme_enqueue_styles’ );
    function my_theme_enqueue_styles() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );
    }
    ?>

    Also, I don’t understand the fact that the Enfold style.css is empty. And also custom.css is empty…. The themes I used before all had style.css files that where not empty. So where are the css rules located then in the Enfold theme?

    Thanks!

    • This topic was modified 7 years, 11 months ago by Alwin.
    #720912

    Hey Alwin,

    We enque that for you in the backend, it’s not really user friendly to have users do that themselves :-)

    The stylesheet is empty because all the styles are included in the css folder in the theme, you can add styles to the file if you want though.

    Best regards,
    Rikard

    #729116

    I have finished building the site now.

    I have used a child theme but I did the most editing by adding css code in the quick section in the Enfold Child Theme settings.

    Can I leave the css code there, or is it better to copy the code the the style.css in my child theme folder?

    #729140

    Hi,

    The css can be left in the theme options however if you like to have it all at one place or have a large amount of css cod, it can be placed in child theme styles.css file.

    Let us know if you have any queries, we are are happy to help :)

    Best regards,
    Vinay

    #729402

    Hello Vinay,

    Thank you. Just to be sure before I mess up the site. This is how my style.css in my child theme looks like now:

    /*
    Theme Name: Enfold Child Theme
    Theme URI: http://www.online-hrm-tools.nl
    Description: Child Theme for online-hrm-tools
    Author: Optiion Webdesign Groningen
    Author URI: http://www.optiion.nl
    Template: enfold
    Version: 1.0.0
    *

    Now, can I just add the code from the quick settings under this code? Then it would look like this:

    /*
    Theme Name: Enfold Child Theme
    Theme URI: http://www.online-hrm-tools.nl
    Description: Child Theme for online-hrm-tools
    Author: Optiion Webdesign Groningen
    Author URI: http://www.optiion.nl
    Template: enfold
    Version: 1.0.0
    */

    @media only screen and (max-width: 1024px) {
    nav.main_menu {display:none !important;}
    #advanced_menu_toggle, #advanced_menu_hide {display:block !important;}
    }

    .html_header_mobile_behavior #mobile-advanced span > a:before{ top: 0px; }

    #mobile-advanced ul{margin:0; padding:0; display: block; width:100%; left:0; position: relative;}
    #mobile-advanced a , #mobile-advanced .mega_menu_title{padding:13px 28px; border-bottom-style: solid; border-bottom-width:1px; width:100%; display:block; margin:0; text-decoration: none; position: relative; cursor: pointer; }
    #mobile-advanced ul a, #mobile-advanced .mega_menu_title{padding-left:50px;}
    #mobile-advanced ul ul a{padding-left:80px;}
    #mobile-advanced ul ul ul a{padding-left:110px;}
    #mobile-advanced ul ul ul ul a{padding-left:140px;}

    /*mega menu fixes*/
    #mobile-advanced .avia-bullet{display:none;}
    #mobile-advanced .avia_mega_div{width:100%; margin:0; float: none;}
    #mobile-advanced .mega_menu_title a{padding:0; border:none;}
    #mobile-advanced .avia_mega_text_block{display:none;}

    #advanced_menu_toggle, #advanced_menu_hide{position: absolute;border-radius: 2px;height: 46px;width: 46px;line-height: 46px;text-decoration: none;text-align: center;right: 2%;top: 50%;margin-top: -23px;z-index: 10000;border-style:solid;border-width: 1px;font-size: 30px;display:none;}

    .bottom_nav_header #advanced_menu_toggle{top:40px;}

    #advanced_menu_hide{
    z-index: 10050;
    visibility: hidden;
    opacity: 0;
    top: 44px;
    right: 23px;
    }

    That’s all? Is this the correct way to do it?
    Or is it also important how the functions.php looks like:

    <?php

    /*
    * Add your own functions here. You can also copy some of the theme functions into this file.
    * WordPress will use those functions instead of the original functions then.
    */

    function wp_change_aviajs() {
    wp_dequeue_script( ‘avia-shortcodes’ );
    wp_enqueue_script( ‘avia-shortcodes-child’, get_stylesheet_directory_uri().’/js/shortcodes.js’, array(‘jquery’), 2, true );
    }
    add_action( ‘wp_print_scripts’, ‘wp_change_aviajs’, 100 );

    Thank you for your help!

    #729719

    Hi,

    Yes, you should be able to do that. Make sure that you save your code in a local file also in case you should have any problems though.

    Best regards,
    Rikard

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.