0
votes

I am new to wordpress.

In WP Admin panel I want to check login once again before creating new pages/plugins/custom admin pages.

I searched a lot but didn't get any useful info. So I want to know is there any plugin or function available or I need to do it manually?

2
Yes I know we can't create pages without Admin login but still I want to do this functionality for some few inbuilt and some custom sensible pages. - Jaydeep Pandya

2 Answers

0
votes

Jaydeep -

Wordpress has built in function to check whether user is logged in or not.

For example:

<?php
if ( is_user_logged_in() ) {
    echo 'Welcome, registered user!';
} else {
    echo 'Welcome, visitor!';
}
?>

Click to get more information.

If the above is not pertinent, feel free to ignore it. And do let me know more about your problem.

0
votes
<?php
include_once 'wp-config.php';
if ( is_user_logged_in() ) {
 // Display WordPress login form:
   $args = array(
    'redirect' => Username custom redirect location, 
    'form_id' => 'loginform-custom',
    'label_username' => __( 'Username custom text' ),
    'label_password' => __( 'Password custom text' ),
    'label_remember' => __( 'Remember Me custom text' ),
    'label_log_in' => __( 'Log In custom text' ),
    'remember' => true
);
wp_login_form( $args );
}
?>

As per @go4gory's suggestion. Ref : Customizing_the_Login_Form