funtion add_profile_page(){
$title_of_page = "page name";
if( null == get_page_by_title( $title_of_page ) ) {
$post_id = wp_insert_post(
array(
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_author' => '1',
'post_name' => 'namehere',
'post_title' => $title_of_page,
'post_status' => 'publish',
'post_type' => 'page'
)
);
update_post_meta($post_id, '_wp_page_template', 'mycustomprofile');
}
}
add_filter( 'after_setup_theme', 'add_profile_page' );
your template page
/*
Template Name : mycustomprofile
*/
// Do whatever you want here
Related Posts:
- How to restrict attachment download to a specific user?
- How to restrict logged user to view only certain pages?
- Limit post display to post authors and create an exception for specific pages
- Suggestions for allowing basic users to view their own posts?
- Using JWT to authenticate a user with an external system?
- Allow anonymous user to access Themes Customizer
- How to restrict a page [without plugin]
- Is there an existing capability to allow editing of only pre-existing pages? If not, a good way to implement this?
- Restrict the user access in multi site for non-assigned blogs
- How to make user inactive by default while registering?
- Restrict certain posts from being sent to the feed subscribers
- How to set privilege to wordpress subscriber for private page
- Restrict access to specific users
- Allow access on a page to just only a specific member
- authenticate user without password from email activation link [duplicate]
- User Access Manager plugin
- Hide everything on site for visitors except specific page IDs
- How can we Restrict to access a certain wordpress page to all ip address except some which we allow
- Restrict post to user_id
- add_option_page capability behaving strange
- Access denied on Published Pages but not on WordPress /wp-admin/
- Allow non logged users to visit only login page and password reset page
- How can I allow users to make groupings of posts
- Is user listing on wordpress private?
- How can I allow an User to publish only 5 posts per month?
- How to “Global Ignore” / “Hell Ban” someone, restrict post visibility to the author only?
- Conditional menu for registerd users/guests (Genesis framework)
- How can I create an upload page for (and only visible to) specific users?
- User restricted only show posts assigned to current user
- remove wp admin menu by customer user role
- One Site as a part of Multisite to be hidden (Un-published) from Public?
- Custom Roles for access to specific term(s)
- Restrict access to trash, only admin
- ‘post’ only for editor and administrator
- Why: sticky front page code, shows latest non-sticky on logged-in front page
- Downloadable content only for subscribers?
- Access denied error when logged in as admin
- Disable all admin UI access to authors (except to custom post type add, edit and modify)
- Hide all pages except landing page
- Hide front-end from every logged out user and redirect them to the default login page
- Restrict the list of parent pages to only those which are created by current user
- How to restrict access to a page?
- How to restrict an admin page, if the user is not superadmin?
- How to restrict access to a single for users I’ve authorized? [closed]
- How can I change access permissions across many pages?
- How do I get the access type in WordPress?
- How can I restrict a custom WordPress role access to only a specific plugin?
- How to create a front facing user sign up, log in and profile pages like FoodGawker.Com [closed]
- Profiles site with access levels
- User access control in sidebar archive and categorires
- Plugins that restrict access based on user group/roles
- Is there a way to create folders restricted to specific users to open?
- Restrict access for wp-admin panel
- Specify the level of access to different pages at the time of user creation
- When add analytics script, wordpress user login not working
- Hide WordPress “wp-admin” dashboard to User IDS
- How to show private pages based on a user’s role?
- I cannot access but but wp-admin works normally
- about visibility in wordpress regarding of roles
- How to use url formatter with integer
- Can access main URL and Dashboard but not any posts or pages [closed]
- Restrict access to custom post type and filter from every query
- How to List only the users created by a particular user
- How to enable to the user send content and save as draft entry?
- search does not yield access restricted results
- Hide page link in main menu from anonymous users
- Use WordPress engine for user registration and management
- How to make future posts visible to selected visitors without login
- Add existing user as administrator
- Restricting certain blog posts by date?
- Split post edit screen into sub-edit screens for users, is this good or bad, and is it possible?
- Premium Members Section of website
- How to restrict posts only from a certain category
- How to block external download link access if visitor not referred from WP?
- Multisite Login Access Restrictions
- Two users attempt to modify a page
- How can I hide a category from Contributors in the edit/add new post screen?
- Restrict users on multisite WordPress install
- Custom user profile, registration, login page with theme
- How can I get multisite primary blog (url or path) for current user?
- How do I perform a “get” call to an external API, and then display the JSON results on a page in my WordPress site?
- Taxonomies, restrict editing and creation of terms?
- Plugin to restrict access to pages in wp-admin
- not logged in users can’t submit form
- DOMAIN_CURRENT_SITE constant being regularly overridden [closed]
- Implementing an image hosting website using WordPress? [closed]
- How to force acceptance of site terms on first login?
- Using WordPress to build membership Page
- Accessing a protected property of a post
- Disable site visiting and user logins excepting for a specific user
- Membership & Event Registration/Management plus-ins for non-profit [closed]
- One Time Access URL after purchasing subscription
- Anonymous users can not access website
- Is there a way to allow users with “Subscriber” user role to access media library in backend and frontend
- Restrict Users to Only Edit Media Owned by Users in Their Role
- How to make this custom capability work? [duplicate]
- ERROR message: “The site is experiencing technical difficulties. Please check your site admin email inbox for instructions.”
- Memberpress: Can I add a second email address?
- WordPress Multisite FQDN Admin Access
- Allow users to only CREATE one single (custom) post