Custom button in Wordpress Dashboard
up vote
0
down vote
favorite
We would like to create a custom button in the wordpress dashboard,
We want this button to hold our pages we create for clients,
Because I want to keep the pages section separate from our "Client" pages

i hope this makes sense
wordpress
add a comment |
up vote
0
down vote
favorite
We would like to create a custom button in the wordpress dashboard,
We want this button to hold our pages we create for clients,
Because I want to keep the pages section separate from our "Client" pages

i hope this makes sense
wordpress
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
We would like to create a custom button in the wordpress dashboard,
We want this button to hold our pages we create for clients,
Because I want to keep the pages section separate from our "Client" pages

i hope this makes sense
wordpress
We would like to create a custom button in the wordpress dashboard,
We want this button to hold our pages we create for clients,
Because I want to keep the pages section separate from our "Client" pages

i hope this makes sense
wordpress
wordpress
asked Nov 21 at 16:25
Lewis Boxer
105
105
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
0
down vote
It's really quite straight forward, just takes a bit of getting used to.
You ideally need to follow the docs:
https://codex.wordpress.org/Adding_Administration_Menus
https://developer.wordpress.org/reference/functions/add_menu_page/
This will guide you in how to set up an admin menu.
<?php add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position ); ?>
Will be the code you call when creating the admin sidebar menu item, however, there are more functions for create sub menu pages under it etc.
What I think you are looking for though, is a Custom Post Type for your clients...
https://codex.wordpress.org/Post_Types
function create_post_type() {
register_post_type( 'client_posttype',
array(
'labels' => array(
'name' => __( 'Clients' ),
'singular_name' => __( 'Client' )
),
'public' => true,
'has_archive' => true,
)
);
}
add_action( 'init', 'create_post_type' );
Something similar to above will get you started.
If it's all a bit much, you can generate CPT code:
https://generatewp.com/post-type/
Then have a look at the generated code to work out what it is that you would have coded yourself.
add a comment |
up vote
0
down vote
Test this :)
class options_page {
function __construct() {
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
}
function admin_menu() {
add_menu_page( 'Clients', 'Clients Page', 'edit_posts', 'clients_page', 'my_clients', '', 24);
}
function settings_page() {
echo 'This is the page content';
}
}
new options_page;
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
It's really quite straight forward, just takes a bit of getting used to.
You ideally need to follow the docs:
https://codex.wordpress.org/Adding_Administration_Menus
https://developer.wordpress.org/reference/functions/add_menu_page/
This will guide you in how to set up an admin menu.
<?php add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position ); ?>
Will be the code you call when creating the admin sidebar menu item, however, there are more functions for create sub menu pages under it etc.
What I think you are looking for though, is a Custom Post Type for your clients...
https://codex.wordpress.org/Post_Types
function create_post_type() {
register_post_type( 'client_posttype',
array(
'labels' => array(
'name' => __( 'Clients' ),
'singular_name' => __( 'Client' )
),
'public' => true,
'has_archive' => true,
)
);
}
add_action( 'init', 'create_post_type' );
Something similar to above will get you started.
If it's all a bit much, you can generate CPT code:
https://generatewp.com/post-type/
Then have a look at the generated code to work out what it is that you would have coded yourself.
add a comment |
up vote
0
down vote
It's really quite straight forward, just takes a bit of getting used to.
You ideally need to follow the docs:
https://codex.wordpress.org/Adding_Administration_Menus
https://developer.wordpress.org/reference/functions/add_menu_page/
This will guide you in how to set up an admin menu.
<?php add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position ); ?>
Will be the code you call when creating the admin sidebar menu item, however, there are more functions for create sub menu pages under it etc.
What I think you are looking for though, is a Custom Post Type for your clients...
https://codex.wordpress.org/Post_Types
function create_post_type() {
register_post_type( 'client_posttype',
array(
'labels' => array(
'name' => __( 'Clients' ),
'singular_name' => __( 'Client' )
),
'public' => true,
'has_archive' => true,
)
);
}
add_action( 'init', 'create_post_type' );
Something similar to above will get you started.
If it's all a bit much, you can generate CPT code:
https://generatewp.com/post-type/
Then have a look at the generated code to work out what it is that you would have coded yourself.
add a comment |
up vote
0
down vote
up vote
0
down vote
It's really quite straight forward, just takes a bit of getting used to.
You ideally need to follow the docs:
https://codex.wordpress.org/Adding_Administration_Menus
https://developer.wordpress.org/reference/functions/add_menu_page/
This will guide you in how to set up an admin menu.
<?php add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position ); ?>
Will be the code you call when creating the admin sidebar menu item, however, there are more functions for create sub menu pages under it etc.
What I think you are looking for though, is a Custom Post Type for your clients...
https://codex.wordpress.org/Post_Types
function create_post_type() {
register_post_type( 'client_posttype',
array(
'labels' => array(
'name' => __( 'Clients' ),
'singular_name' => __( 'Client' )
),
'public' => true,
'has_archive' => true,
)
);
}
add_action( 'init', 'create_post_type' );
Something similar to above will get you started.
If it's all a bit much, you can generate CPT code:
https://generatewp.com/post-type/
Then have a look at the generated code to work out what it is that you would have coded yourself.
It's really quite straight forward, just takes a bit of getting used to.
You ideally need to follow the docs:
https://codex.wordpress.org/Adding_Administration_Menus
https://developer.wordpress.org/reference/functions/add_menu_page/
This will guide you in how to set up an admin menu.
<?php add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position ); ?>
Will be the code you call when creating the admin sidebar menu item, however, there are more functions for create sub menu pages under it etc.
What I think you are looking for though, is a Custom Post Type for your clients...
https://codex.wordpress.org/Post_Types
function create_post_type() {
register_post_type( 'client_posttype',
array(
'labels' => array(
'name' => __( 'Clients' ),
'singular_name' => __( 'Client' )
),
'public' => true,
'has_archive' => true,
)
);
}
add_action( 'init', 'create_post_type' );
Something similar to above will get you started.
If it's all a bit much, you can generate CPT code:
https://generatewp.com/post-type/
Then have a look at the generated code to work out what it is that you would have coded yourself.
answered Nov 21 at 16:32
Dammeul
791515
791515
add a comment |
add a comment |
up vote
0
down vote
Test this :)
class options_page {
function __construct() {
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
}
function admin_menu() {
add_menu_page( 'Clients', 'Clients Page', 'edit_posts', 'clients_page', 'my_clients', '', 24);
}
function settings_page() {
echo 'This is the page content';
}
}
new options_page;
add a comment |
up vote
0
down vote
Test this :)
class options_page {
function __construct() {
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
}
function admin_menu() {
add_menu_page( 'Clients', 'Clients Page', 'edit_posts', 'clients_page', 'my_clients', '', 24);
}
function settings_page() {
echo 'This is the page content';
}
}
new options_page;
add a comment |
up vote
0
down vote
up vote
0
down vote
Test this :)
class options_page {
function __construct() {
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
}
function admin_menu() {
add_menu_page( 'Clients', 'Clients Page', 'edit_posts', 'clients_page', 'my_clients', '', 24);
}
function settings_page() {
echo 'This is the page content';
}
}
new options_page;
Test this :)
class options_page {
function __construct() {
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
}
function admin_menu() {
add_menu_page( 'Clients', 'Clients Page', 'edit_posts', 'clients_page', 'my_clients', '', 24);
}
function settings_page() {
echo 'This is the page content';
}
}
new options_page;
edited Nov 21 at 16:46
answered Nov 21 at 16:38
Sco
1665
1665
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53416445%2fcustom-button-in-wordpress-dashboard%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown