One option would be to create a custom page template. Within that template, you can check for POSTed variables. Something to the effect of:
<?php
/*
* Template Name: Login form
*/
if(!empty($_POST['username'])) {
// check credentials and if valid display data
} else {
// display login form
}
Once you’ve created this file and uploaded it in your theme files (preferably a child theme, if you are not using a custom-built theme; save it as something like tpl-login.php
for easy reference) you can create a Page in WordPress and there will be a dropdown to select the template. Select this “Login form” template, publish the page or save a draft, and you can continue editing your page template until it performs all the functions you need.
Related Posts:
- Add value to usermeta without removing previous values?
- Using Echo in ShortCode – Stuck
- Insert post without actions/hooks
- How to create and work with custom data / tables (i.e., for arbitrary data)?
- PHP code inside shortcodes
- Remove one value in dismissed_wp_pointers?
- Accessing data from a non-WP database/table within a page content
- How to check if a meta value has already been assigned to any user?
- How to display data from custom table in wordpress phpmyadmin
- Calculating a large number of MYSQL queries as customshort codes, slow
- Weird 404 URL Problem – domain name being placed at end of urls
- Modify custom field input data before creating a new post
- Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
- Replace shortcode in substring
- Change order of custom submenu link in WP Admin?
- $wpdb returns duplicate posts
- Basic wpdb update question
- Action Hook Inside WordPress Plugin Shortcode
- PHP Helper Class to create shortcodes
- MySQL Query Returns Array () In Shortcode
- Conditional formatting on data fetched from MYSQL
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- I want to hide “sold by” on certain pages with id page 43
- Using the same shortcode to show any table from the database
- WP Custom tables query
- Display total count of products in orders of a specific order status
- Woocomerce custom add to cart button edit functionality [closed]
- How to Insert Shortcodes into Theme?
- How do I implement a .diff changeset from core.trac.wordpress.org locally?
- WP_cron won’t trigger my action
- Looking for most performant way to execute several similar WP queries within shortcodes
- How can I get content inside one shortcode to another shortcode?
- Query String being Removed Creating a Pagination Issue within a Custom Plugin
- PHP can I add line numbers to file_get_contents()
- Template part inside shortcode, unexpected reult
- How to convert objects into arrays
- How to get 2 or multiple custom post types in wordpress functions.php
- Shortcode Inside Class Not Working
- custom shortcode will not display the wrapped content
- Shortcode content output but not in correct place
- Ajax $wpdb not returning table data
- Converting MYSQL to WordPress $WPDB
- is_page “range” for if statement?
- Multiple choice in a custom taxonomy
- How to select WooCommerce products by post_meta and order them
- How can I generate random numbers inside my shortcodes on each implementation?
- Setting All Drafts to ‘exclude-from-catalog’ in WooCommerce
- Stumped on migration
- Is there a way to get 3+ dimensional array from a single MySql command
- Displaying theme options in css
- How to add custom post meta to default blog post?
- Custom Plugin For Converting CSV To MySQL
- Use WP_Query in shortcode
- Creating bulk posts with Youtube videos
- Shortcode API: How to get name that matched shortcode RegEx?
- Random Default Avatar Function
- Shortcode content filter?
- Why is variable not working on custom sql query using wpdb?
- Create shortcodes within foreach loop (using array)
- Hide wordpress field if data is empty in post!
- Show MySQL errors that occur when I excute $wpdb->insert()
- Change the site tagline (or similar) based on current page
- Trouble creating conditional PHP for nav menu items with children for custom Walker
- Custom Theme, Custom shortcode not working
- Get WooCommerce product details and transfer them to a custom DB table
- Setting custom canonical urls
- Trigger popup in a php if/else statement
- Only show search results with if current date is between two dates?
- Is XAMPP faster than running LAMP in WSL on Windows 10? [closed]
- database interactions using OOP
- Customizer: Output default value in Customizer CSS
- How to add just one specific page to widget without plugin?
- Adding Default Settings to Theme My Login plugin
- create a select input with menus created on a custom options page
- Taxonomy linked to pages
- action is not called after a php request
- WordPress Site Running Extremely Slow on Dedicated Server
- Checking for new message using AJAX and PHP. Server overload?
- How can I export posts with featured images, without download them
- Append HTML Using Shortcode
- Remove an action hook within a Class
- Ajax not working es expected (Returns 0)
- Why is file_get_contents returning page source?
- Plugin CSS not enqueing
- How to pass arguments to add_action() or retrieve return value of called function?
- How to securely provide a $_POST var in WP_Query with PHP 7?
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- Can’t get wp_insert_post to work
- Custom Form Processing Issue
- Create WP_Query to search for posts by their categories or their parent/child categories
- Different loop output every x posts in custom post type
- add_action shortcut?
- What is a valid parent for get_terms()?
- WordPress blog post url on category page
- How to output a PHP file values by shortcode?
- Showing content from one page on another
- Changing layout with wp_customise
- WP dynamic featured image – Can’t get second featured image url
- Get updated query results on page after insert in database
- WSoD being caused by this piece of code