Skip to content

Commit d451d0b

Browse files
authored
Update functions.php
1 parent c582856 commit d451d0b

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

functions.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,34 @@ function register_testimonials_module() {
8989
register_post_type( 'testimonials', $args );
9090
}
9191
add_action( 'init', 'register_testimonials_module', 0 );
92+
93+
94+
/* To enable custom theme options with acf plugin */
95+
/**
96+
* ACF Theme Options
97+
*/
98+
if ( function_exists( 'acf_add_options_page' ) ) {
99+
100+
acf_add_options_page(array(
101+
'page_title' => 'Theme Options',
102+
'menu_title' => 'Theme Options',
103+
'menu_slug' => 'theme-general-settings',
104+
'capability' => 'edit_posts',
105+
'redirect' => false,
106+
)
107+
);
108+
}
109+
110+
/**
111+
* Add ACF Options to Admin Bar
112+
*/
113+
add_action( 'admin_bar_menu', 'options_adminbar', 999 );
114+
115+
function options_adminbar( $wp_admin_bar ) {
116+
$args = array(
117+
'id' => 'theme_options',
118+
'title' => 'Theme Options',
119+
'href' => '/wp-admin/admin.php?page=theme-general-settings',
120+
);
121+
$wp_admin_bar->add_node( $args );
122+
}

0 commit comments

Comments
 (0)