Hassan Butt
Hassan Butt

Reputation: 1

I want to create new page on a button click in wordpress

I want to send GET, POST request to server to get a response. how to do that in Wordpress?

Upvotes: 0

Views: 1423

Answers (1)

Elvin Haci
Elvin Haci

Reputation: 3572

Here it is:

<a href="<?php echo admin_url('post-new.php?post_type=page');?>">
Create new page</a>

You can place this code whereever you want in your theme. To give the link button UI, you can use any CSS button class of your theme. F.e.

<a class="btn btn-info" href="<?php echo admin_url('post-new.php?post_type=page');?>">
    Create new page</a>

Upvotes: 0

Related Questions