Here’s how you can customize the HTML, look & feel of the DAP Sidebar Login Widget.
There is a file in the following folder…
/wp-content/plugins/DAP-WP-LiveLinks/
by name…
DAP-WP-LoginForm-LoginLogout.html
Make a copy of that file on your desktop, rename it to…
customDAP-WP-LoginForm-LoginLogout.html
(just added the text “custom” at the front of the original file’s name).
You can then modify this new file however you want, including altering spacing, and that’s what will be displayed.
Just be careful what you change – do not modify the field names or the submit URL. Feel free to change other visual elements.
2 comments ↓
In Customizing Login Form tutorial, you say to rename the file.
For this form, you say to make a copy and then rename the copy.
Should both files be available on the site? Or do we want only the CUSTOM file available?
ok i figured it out…if anyone needs it here it is –i copied this but added a few things…edit the else if statement on line 52 of plugins/DAP-WP-LiveLinks/DAP-LoginLogout.php to this:
else if(Dap_Session::isLoggedIn()) { //Logged in
$session = Dap_Session::getSession();
$user = $session->getUser();
$user = Dap_User::loadUserById($user->getId()); //reload User object
if(isset($user)) {
$firstname= $user->getFirst_name();
}
$logoutHTMLFilepath = “/DAP-WP-LiveLinks/DAP-WP-LogoutHTML.html”;
if( file_exists(WP_PLUGIN_DIR . “/DAP-WP-LiveLinks/customDAP-WP-LogoutHTML.html”) ) {
$logoutHTMLFilepath = “/DAP-WP-LiveLinks/customDAP-WP-LogoutHTML.html”;
}
$output = “Welcome ” . $firstname .”!”;
$output .= “”;
$output .= “My Profile—My Content“;
$output .= “”;
$output .= file_get_contents(WP_PLUGIN_DIR . $logoutHTMLFilepath);
echo $output;
} //End Logged In
/* After widget (defined by themes). */
echo $after_widget;
}
Leave a Comment