-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
45 lines (38 loc) · 1.35 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
function devtheme_setup() {
load_theme_textdomain('devtheme');
add_theme_support('title-tag');
add_theme_support('custom-logo');
add_theme_support('post-thumbnails');
register_nav_menus(
array(
'topmemu' => __('Top Menu', 'devtheme'),
'bottommemu' => __('Bottom Menu', 'devtheme')
)
);
}
add_action('after_setup_theme', 'devtheme_setup');
// Assets
function devtheme_stylesheet() {
wp_enqueue_style('bootstrap', 'https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css');
wp_enqueue_style('devtheme_main_style', get_stylesheet_uri( ), '', '1.0.0');
}
add_action('wp_enqueue_scripts', 'devtheme_stylesheet');
// Widget function | parameter | hook
function devtheme_widgets() {
register_sidebar(array(
'name' => 'Right Sidebar',
'id' => 'right-sidebar',
'before_widget' => '<div class="right-side">',
'after_widget' => '</div>',
'before_title' => '<h2>', //if your add class for title then add with class
'after_title' => '</h2>'
));
}
add_action('widgets_init', 'devtheme_widgets');
//Read More
function devtheme_continue($words){
$devtheme_article = explode(' ', the_content());
$devtheme_article_slice = array_slice($devtheme_article, 0, $words);
echo implode(' ', $devtheme_article_slice);
}