require_once 'library/enqueue-scripts.php';
/** Add theme support */
require_once 'library/theme-support.php';
/** Add Nav Options to Customer */
require_once 'library/custom-nav.php';
/** Add protocol relative theme assets */
require_once 'library/protocol-relative-theme-assets.php';
/** Add Options for Advanced Custom Fields */
if (function_exists('acf_add_options_page')) {
    acf_add_options_page();
    acf_add_options_sub_page('Footer');
    acf_add_options_sub_page('Social');
}
/** Change Options Title for Admin Menu */
if (function_exists('acf_set_options_page_title')) {
    acf_set_options_page_title(__('Global'));
}
/** Add Logo Upload Functionality */
function themeslug_theme_customizer($wp_customize)
{
    $wp_customize->add_section('themeslug_logo_section', array('title' => __('Logo', 'themeslug'), 'priority' => 30, 'description' => 'Upload a logo to replace the default site name and description in the header'));
    $wp_customize->add_setting('themeslug_logo');
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'themeslug_logo', array('label' => __('Logo', 'themeslug'), 'section' => 'themeslug_logo_section', 'settings' => 'themeslug_logo')));
}
add_action('customize_register', 'themeslug_theme_customizer');
/** Add Search Bar to Header */
add_filter('wp_nav_menu_items', 'add_search_box_to_menu', 10, 2);
function add_search_box_to_menu($items, $args)
{
    if ($args->theme_location == 'primary') {
        return $items . get_search_form();
Beispiel #2
0
add_filter('body_class', __NAMESPACE__ . '\\body_class');
/**
 * Clean up the_excerpt()
 */
function excerpt_more()
{
    return ' &hellip; <a href="' . get_permalink() . '">' . __('Continued', 'sage') . '</a>';
}
add_filter('excerpt_more', __NAMESPACE__ . '\\excerpt_more');
/**
 * Disable Admin Bar for all users
 */
show_admin_bar(false);
/**
 * Specify ACF Options Page
 */
if (function_exists('acf_add_options_page')) {
    acf_add_options_page();
    acf_set_options_page_title(__('Global Fields'));
}
/**
 * Gravity Forms
 */
/** Insert scripts in footer */
add_filter('gform_init_scripts_footer', '__return_true');
/** Changes the default Gravity Forms AJAX spinner. */
add_filter('gform_ajax_spinner_url', __NAMESPACE__ . '\\spinner_url', 10, 2);
function spinner_url($image_src, $form)
{
    return get_stylesheet_directory_uri() . '/dist/images/loading-white.gif';
}
Beispiel #3
0
<?php

// If we need post thumbnails, uncomment this.
add_theme_support('post-thumbnails');
// Set up our menus
register_nav_menus(array('main_nav' => 'Primary Navigation', 'secondary_nav' => 'Secondary Navigation'));
//Change the Options Page menu to 'Theme Options'
if (function_exists('acf_set_options_page_title')) {
    acf_set_options_page_title(__('Theme Options'));
}
//Custom ACF Options Pages
if (function_exists('acf_add_options_sub_page')) {
    acf_add_options_sub_page('Donate');
    acf_add_options_sub_page('Newsletter');
    acf_add_options_sub_page('Footer');
}
//remove_filter ('acf_the_content', 'wpautop');
    wp_register_script('gsap-tweenmax', get_template_directory_uri() . '/js/vendor/gsap/minified/TweenMax.min.js', array('jquery', 'angular'));
    /*wp_register_script( 'gsap-tweenlite', get_template_directory_uri() . '/js/vendor/gsap/minified/TweenLite.min.js', array('jquery', 'angular'));
    
    	wp_register_script( 'gsap-timelinelite', get_template_directory_uri() . '/js/vendor/gsap/minified/TimelineLite.min.js', array('jquery', 'angular', 'gsap-tweenlite'));	
    
    	wp_register_script( 'gsap-cssplugin', get_template_directory_uri() . '/js/vendor/gsap/minified/plugins/CSSPlugin.min.js', array('jquery', 'angular', 'gsap-tweenlite'));*/
    wp_register_script('gsap-scrolltoplugin', get_template_directory_uri() . '/js/vendor/gsap/minified/plugins/ScrollToPlugin.min.js', array('jquery', 'angular', 'gsap-tweenmax'));
    wp_register_script('gsap-splittext', get_template_directory_uri() . '/js/vendor/gsap/minified/utils/SplitText.min.js', array('jquery', 'angular', 'gsap-tweenmax'));
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
}
add_action('wp_enqueue_scripts', 'johanbissemattsson_scripts');
if (function_exists('acf_add_options_page')) {
    acf_add_options_page();
    acf_set_options_page_title(__('Header & Footer'));
}
/**
 * Implement the Custom Header feature.
 */
//require get_template_directory() . '/inc/custom-header.php';
/**
 * Custom template tags for this theme.
 */
require get_template_directory() . '/inc/template-tags.php';
/**
 * Custom functions that act independently of the theme templates.
 */
require get_template_directory() . '/inc/extras.php';
/**
 * Customizer additions.
Beispiel #5
0
<?php

/* Enable thumbnails to post & page */
add_theme_support('post-thumbnails', array('post', 'page'));
add_filter('show_admin_bar', '__return_false');
/* Register menu */
// register_nav_menus( array(
//     'primary' => __( 'Primary Menu', 'Main navigation' ),
// ) );
/* Remove auto added p-tags */
// remove_filter( 'the_content', 'wpautop' );
// remove_filter( 'the_excerpt', 'wpautop' );
//
if (function_exists('acf_add_options_page')) {
    acf_add_options_page();
    acf_set_options_page_title(__('Footer indhold'));
}
add_action('init', 'my_custom_init');
function my_custom_init()
{
    remove_post_type_support('page', 'editor');
}