-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
133 lines (113 loc) · 4.68 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?php
function powercoders_setup_theme(){
add_theme_support('title-tag'); // https://codex.wordpress.org/Title_Tag
add_theme_support('post-thumbnails'); // https://codex.wordpress.org/Post_Thumbnails
add_theme_support('menus'); // Add Menu Support
// Add Thumbnail Theme Support
add_theme_support('post-thumbnails');
add_image_size('large', 700, '', true); // Large Thumbnail
add_image_size('medium', 250, '', true); // Medium Thumbnail
add_image_size('small', 120, '', true); // Small Thumbnail
add_image_size('custom-size', 700, 200, true); // Custom Thumbnail Size call using the_post_thumbnail('custom-size');
register_nav_menus(array(
'main' => 'Main Menu',
'get-involved' => 'Get Involved Menu'
));// we will be using one menu for navigation
}
add_action('after_setup_theme', 'powercoders_setup_theme');
function powercoders_enqueue_styles()
{
// https://codex.wordpress.org/Plugin_API/Action_Reference/wp_enqueue_scripts
wp_enqueue_style( 'style.css', get_template_directory_uri() . '/style.css', array() );
}
add_action('wp_enqueue_scripts', 'powercoders_enqueue_styles');
function powercoders_enqueue_script(){
wp_enqueue_script('waypoints-js',get_template_directory_uri() . '/js/jquery.waypoints.js',['jquery']);
wp_enqueue_script('materilaize-js',get_template_directory_uri() . '/js/materialize.js',['jquery']);
wp_enqueue_script('main-powercoders-js',get_template_directory_uri() . '/js/init.js',['waypoints-js','materilaize-js','jquery']);
}
add_action('wp_enqueue_scripts', 'powercoders_enqueue_script');
function powercoders_widgets_init()
{
// https://codex.wordpress.org/Widgets_API
register_sidebar( array(
'name' => 'Content Footer', 'powercoders',
'id' => 'content-footer',
'description' => 'Appears in the footer area',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h5 class="widget-title">',
'after_title' => '</h5>',
) );
register_sidebar( array(
'name' => 'Get Involved Footer', 'powercoders',
'id' => 'get-involved-footer',
'description' => 'Appears in the footer area',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h5 class="widget-title">',
'after_title' => '</h5>',
) );
register_sidebar( array(
'name' => 'Powercoders Footer', 'powercoders',
'id' => 'powercoders-footer',
'description' => 'Appears in the footer area',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h5 class="widget-title">',
'after_title' => '</h5>',
) );
register_sidebar( array(
'name' => 'Mailinglist Footer', 'powercoders',
'id' => 'mailinglist-footer',
'description' => 'Appears in the footer area',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h5 class="widget-title">',
'after_title' => '</h5>',
) );
register_sidebar( array(
'name' => 'Donate Footer', 'powercoders',
'id' => 'donate-footer',
'description' => 'Appears in the footer area',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h5 class="widget-title">',
'after_title' => '</h5>',
) );
}
add_action('widgets_init', 'powercoders_widgets_init');
function powercoders_post_types(){
//person post type
register_post_type('person',array(
'supports' => array('title', 'editor',),
'rewrite' => array('slug' => 'persons'),
'has_archive' => true,
'public' => true,
'labels' => array(
'name' => 'Persons',
'add_new_item' => 'Add New Person',
'edit_item' => 'Edit Person',
'all_items' => 'All Persons',
'singular_name' => 'Person'
),
'menu_icon' =>'dashicons-admin-users'
));
//Program post type
register_post_type('program',array(
'supports' => array('title', 'editor'),
'rewrite' => array('slug' => 'programs'),
'has_archive' => true,
'public' => true,
'labels' => array(
'name' => 'programs',
'add_new_item' => 'Add New Program',
'edit_item' => 'Edit Program',
'all_items' => 'All Programs',
'singular_name' => 'Program'
),
'menu_icon' =>'dashicons-awards'
));
}
add_action('init','powercoders_post_types');
include( get_template_directory() . '/acf-faq.php');