$d . '/css/framework.css', 'deps' => false, ); // Include ss-social-font $styles['asm-theme-ss-social-font'] = array( 'src' => $d . '/fonts/ss-social-regular.css', 'deps' => array( 'asm-theme-framework' ), ); // Main Styles $styles['asm-theme-main-styles'] = array( 'src' => get_stylesheet_uri(), 'deps' => array( 'asm-theme-ss-social-font', 'asm-wp-base', 'asm-theme-framework' ), ); // Enqueue both parent and child styles in child theme if( is_child_theme() ) { $styles['asm-theme-parent-styles'] = array( 'src' => $d . '/style.css', 'deps' => array( 'asm-theme-ss-social-font', 'asm-wp-base', 'asm-theme-framework', 'asm-theme-main-styles' ), ); } // Register styles foreach( $styles as $handle => $style ) { wp_enqueue_style( $handle, $style['src'], $style['deps'], ASSEMBLY_THEME_VERSION ); } // SCRIPTS // Enqueue jQuery wp_enqueue_script( 'jquery' ); // Framework $scripts['asm-theme-framework'] = array( 'src' => $d . '/js/framework.js', 'deps' => array( 'jquery' ), 'footer'=> true ); // Appear $scripts['asm-theme-appear'] = array( 'src' => $d . '/js/jquery.appear.js', 'deps' => array( 'jquery' ), 'footer'=> true ); // Isotope $scripts['asm-theme-isotope'] = array( 'src' => $d . '/js/isotope.pkgd.min.js', 'deps' => array( 'jquery' ), 'footer'=> true ); // Packery $scripts['asm-theme-packery-mode'] = array( 'src' => $d . '/js/packery-mode.pkgd.min.js', 'deps' => array( 'jquery' ), 'footer'=> true ); // Global Script $scripts['asm-theme-main-scripts'] = array( 'src' => $d . '/js/scripts.js', 'deps' => array( 'jquery' ), 'footer'=> true ); // Comment reply script if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } // Register scripts foreach( $scripts as $handle => $script ) { wp_enqueue_script( $handle, $script['src'], $script['deps'], ASSEMBLY_THEME_VERSION, $script['footer'] ); } } // Enqueue Theme Styles & Scripts add_action( 'wp_enqueue_scripts', 'asm_bloc_enqueue_scripts' ); /* TGM Plugin Activation */ /* * asm_bloc_register_required_plugins * * asm_bloc_register_required_plugins * * @type action (init) * @date 08/12/15 * @since 0.5.0 * * @param N/A * @return N/A */ function asm_bloc_register_required_plugins() { $plugins = array( array( 'name' => 'Assembly Website Builder', 'slug' => 'assembly', 'source' => 'https://loopthemes.com/tgm/assembly.zip', 'required' => true, 'version' => '0.5', 'force_activation' => true, 'force_deactivation' => true, 'plugin_info_hooked' => true, //'external_url' => '', ), array( 'name' => 'Assembly Gallery', 'slug' => 'assembly-gallery', 'source' => 'https://loopthemes.com/tgm/assembly-gallery.zip', 'required' => true, 'version' => '0.5', 'force_activation' => true, 'force_deactivation' => true, 'plugin_info_hooked' => true, //'external_url' => '', ), // Contact Form 7 array( 'name' => 'Contact Form 7', 'slug' => 'contact-form-7', 'required' => false, ), ); // Configuration $config = array( 'id' => 'assembly-bloc', 'default_path' => '', 'menu' => 'tgmpa-install-plugins', 'parent_slug' => 'themes.php', 'capability' => 'edit_theme_options', 'has_notices' => true, 'dismissable' => false, 'dismiss_msg' => '', 'is_automatic' => true, 'message' => '' ); tgmpa( $plugins, $config ); } add_action( 'tgmpa_register', 'asm_bloc_register_required_plugins' ); /* * asm_bloc_tgmpa_message_styles * * asm_bloc_tgmpa_message_styles * * @type action (init) * @date 08/12/15 * @since 0.5.0 * * @param N/A * @return N/A */ function asm_bloc_tgmpa_message_styles() { echo ""; } add_action('admin_head', 'asm_bloc_tgmpa_message_styles'); /* * asm_bloc_validate * * asm_bloc_validate * * @type action (init) * @date 08/12/15 * @since 0.5.0 * * @param N/A * @return N/A */ function asm_bloc_validate() { if( function_exists( 'asm_set_setting' ) ){ // Get the page $the_id = asm_get_setting( 'page_id' ); $the_page = get_page( $the_id ); // If we are previewing notice it if( is_preview() ){ esc_html_e( "The current page has not yet been published, please publish the page or post in order to see the content.", 'assembly-bloc' ); exit; } // Validate page if( ! isset( $the_page ) ){ sprintf( esc_html__( "The current page seems to be misconfigured, please click here to check the \"Page States\" under the \"General\" settings.", 'assembly-bloc' ), admin_url( 'admin.php?page=asm-options?#page_states' ) ); exit; } // Return return array( 'the_id' => $the_id, 'the_page' => $the_page ); }else{ // Return require get_template_directory() . '/static/index.php'; exit; } } /* STATIC */ /* * asm_bloc_static_widgets_init * * asm_bloc_static_widgets_init * * @type action (init) * @date 08/12/15 * @since 0.5.0 * * @param N/A * @return N/A */ function asm_bloc_static_widgets_init() { if( class_exists('asm') ) return; // Register Sidebar register_sidebar( array( 'name' => __( 'Side Sidebar', 'assembly-bloc' ), 'id' => 'left-sidebar', 'description' => esc_html__( 'Widgets in this area will be shown on all posts and pages.', 'assembly-bloc' ), 'before_widget' => '
', 'before_title' => ''; echo wp_kses( sprintf( __( 'Hey! Did you know you can get the PRO version of "Bloc" with full ticketing support, license keys and plugin updates (for $49.00) from LOOP Themes? Click here to get it.', 'assembly-bloc' ), 'https://loopthemes.com/checkout/?edd_action=add_to_cart&download_id=4219'), array( 'strong' => array(), 'a' => array( 'href' => array(), 'target' => array() ) ) ); echo "
"; echo wp_kses( sprintf( __( 'Alternatively, do you fancy enhancing your theme with some awesome theme add-ons? Click here to see the add-ons.', 'assembly-bloc' ), add_query_arg( array( 'page' => 'asm-options-addons', ), admin_url( 'admin.php' ) ) ), array( 'strong' => array(), 'a' => array( 'href' => array() ) ) ); echo '