__( 'Main menu', 'materializewordpress' ),
'footer' => __( 'Footer menu', 'materializewordpress' )
)
);
}
if (function_exists('register_sidebar')) {
register_sidebar( array(
'name' => __( 'Footer sidebar 1', 'materializewordpress' ),
'id' => 'footer-widgets-1',
'description' => __( 'First widgets area of the footer', 'materializewordpress' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
));
register_sidebar( array(
'name' => __( 'Footer sidebar 2', 'materializewordpress' ),
'id' => 'footer-widgets-2',
'description' => __( 'Second widgets area of the footer', 'materializewordpress' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '
',
));
register_sidebar( array(
'name' => __( 'Footer sidebar 3', 'materializewordpress' ),
'id' => 'footer-widgets-3',
'description' => __( 'Third widgets area of the footer', 'materializewordpress' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '
',
));
register_sidebar( array(
'name' => __( 'Left sidebar', 'materializewordpress' ),
'id' => 'left-sidebar',
'description' => __( 'Widgets area for left sidebar', 'materializewordpress' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '
',
));
register_sidebar( array(
'name' => __( 'Right sidebar', 'materializewordpress' ),
'id' => 'right-sidebar',
'description' => __( 'Widgets area for right sidebar', 'materializewordpress' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '
',
));
}
}
add_action( 'widgets_init', 'materialize_wordpress_widgets_init' );
/***********************************Theme support************************************************/
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
add_theme_support( 'post-thumbnails' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support('html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
));
function load_translations(){
load_theme_textdomain( 'materializewordpress', get_template_directory() . '/languages' );
}
add_action( 'after_setup_theme', 'load_translations' );
add_editor_style( array() );
/*************************************Search template***********************************************/
/**
* Generate custom search form
*
* @param string $form Form HTML.
* @return string Modified form HTML.
*/
function materializewordpress_search_form( $form ) {
$form = '';
return $form;
}
add_filter( 'get_search_form', 'materializewordpress_search_form' );
/***********************************Comments template***********************************************/
/**
* @return string
*/
function materialize_wordpress_default_image() {
if (wp_get_attachment_image_src(get_post_thumbnail_id(), 'full')[0] != '') {
$image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full')[0];
} else {
$image = get_theme_mod( 'default_image', get_template_directory_uri() . '/img/default-parallax-header-image.jpeg');
}
return $image;
}
/***********************************Comments template***********************************************/
/**
* @param $comments
*/
function materializewordpress_comment($comments) {
global $current_user;
wp_get_current_user();
foreach($comments as $comment) {
$post_id = get_the_ID();
$comment_id = $comment->comment_ID;
$author_email = get_comment_author_email($comment_id);
//get the setting configured in the admin panel under settings discussions "Enable threaded (nested) comments levels deep"
$max_depth = get_option('thread_comments_depth');
//add max_depth to the array and give it the value from above and set the depth to 1
$default = array(
'add_below' => 'comment',
'respond_id' => 'respond',
'reply_text' => 'reply',
'login_text' => __('Log in to Reply', 'default'),
'depth' => 1,
'before' => '',
'after' => '',
'max_depth' => $max_depth
);
?>