Jump to content

Archived

This topic is now archived and is closed to further replies.

kellid

Framework Login Customization

Recommended Posts

kellid

Hello,

 

A few months ago, I added a drop down login box to my header and it worked perfectly.  Since then, I accidentally deleted my header file and when uploading a copy to cpanel, it isn't working properly and I can't figure out why.  I don't believe I changed any of the code in the file and not much else has changed, but when I go to enter my "Username" the box disappears.  

 

Do you see the error? 

 

Thanks in advance for your help!!

 

Regards,

 

Kelli 

<?php 
/**
 * HEADER
 *
 * This file controls the HTML <head> and top graphical markup (including
 * Navigation) for each page in your theme. You can control what shows up where
 * using WordPress and PageLines PHP conditionals.
 *
 * @package     PageLines Framework
 * @since       1.0
 *
 * @link        http://www.pagelines.com/
 * @link        http://www.pagelines.com/tour
 *
 * @author      PageLines   http://www.pagelines.com/
 * @copyright   Copyright (c) 2008-2012, PageLines  hello@pagelines.com
 *
 * @internal    last revised January 23, 2012
 * @version     ...
 *
 * @todo Define version
 */

pagelines_register_hook('pagelines_before_html'); // Hook
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
		<meta http-equiv="content-type" content="text/html;charset=utf-8">
		<?php 		
		pagelines_register_hook('pagelines_head'); // Hook 
		
		wp_head(); // Hook (WordPress) 
			
		pagelines_register_hook('pagelines_head_last'); // Hook ?>

</head>
<?php 

echo pl_source_comment('Start >> HTML Body', 1); ?>
<body <?php body_class( pagelines_body_classes() ); ?>>
<?php 
pagelines_register_hook('pagelines_before_site'); // Hook
	
if(has_action('override_pagelines_body_output')):
	do_action('override_pagelines_body_output');

else:  ?>
<div id="site" class="<?php echo pagelines_layout_mode();?>">
<?php pagelines_register_hook('pagelines_before_page'); // Hook ?>
	<div id="page" class="thepage">
		<?php pagelines_register_hook('pagelines_page'); // Hook ?>
		<div class="page-canvas">
			<?php pagelines_register_hook('pagelines_before_header');?>
			<header id="header" class="container-group">
			<ul class="headerlinks">
<strong><script language="JavaScript">
var myDate = new Date();
/* hour is before noon */
if ( myDate.getHours() < 12 )
{
    document.write("Good Morning!");
}
else  /* Hour is from noon to 5pm (actually to 5:59 pm) */
if ( myDate.getHours() >= 12 && myDate.getHours() <= 17 )
{
    document.write("Good Afternoon!");
}
else  /* the hour is after 5pm, so it is between 6pm and midnight */
if ( myDate.getHours() > 17 && myDate.getHours() <= 24 )
{
    document.write("Good Evening!");
}
else  /* the hour is not between 0 and 24, so something is wrong */
{
    document.write("I'm not sure what time it is!");
}</script></strong>
          <!-- here comes the important part -->
 <!---------------------------------------  DROPDOWN LOGIN CODE STARTS HERE      ---------------------------------------------->
 <style type="text/css">
 .dropdown.open .dropdown-menu {
    display: block;
    padding: 20px !important;
}
 </style>
           <li class="dropdown" id="menu1">
             <a class="dropdown-toggle" data-toggle="dropdown" href="#menu1">
               Login
                <b class="caret"></b>
             </a>
             <div class="dropdown-menu">
<?php
if ( ! is_user_logged_in() ) { // Display WordPress login form:
    $args = array(
        'redirect' => admin_url(), 
        'label_username' => __( 'Username' ),
        'label_password' => __( 'Password' ),
        'label_remember' => __( 'Remember Me!' ),
        'label_log_in' => __( 'Log Me In' ),
        'remember' => true
    );
    wp_login_form( $args );
} else { // If logged in:
    wp_loginout( home_url() ); // Display "Log Out" link.
    echo " | ";
    wp_register('', ''); // Display "Site Admin" link.
}
?>
           </li>
 <!---------------------------------------  DROPDOWN LOGIN CODE ENDS HERE      ---------------------------------------------->

        </ul>
				<div class="outline">
					<?php pagelines_template_area('pagelines_header', 'header'); // Hook ?>
				</div>
			</header>
			<?php pagelines_register_hook('pagelines_before_main'); // Hook ?>
			<div id="page-main" class="container-group">
				<div id="dynamic-content" class="outline">	
<?php 
				pagelines_special_content_wrap_top();

endif;

Share this post


Link to post
Share on other sites
Danny

Hi,

 

Unfortunately, we do not provide support to users who have edited the core files of our products. If you wanted to add some custom code to your header, you will need to use a hook if you wish for use to provide support.

 

I recommend you remove all your custom code so that the header.php file is reverted back to default, then we may be able to provide assistance, although user created code isn't something we provide support for.

 

In my opinion, if all you're trying to do is get some menu items to display when a user is logged in or not logged in, then just use the standard WordPress menu with a plugin like this:

 

https://wordpress.org/plugins/menu-items-visibility-control/


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
kellid

Thanks for your response Danny.  I'm not trying to display menu items but add a dropdown login module to my header.  

I'll look into hooks!

 

 

Share this post


Link to post
Share on other sites
Danny

OK, then yeah Hooks is what you will need to use then.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

  • Similar Content

    • KathleenAspenns
      By KathleenAspenns+
      I would like to upgrade my site to PHP 7, but there is an error warning in the PL Framework theme. I should think this should be fixed asap, I cannot be the only person trying to be up to date.
      1976 | ERROR | preg_replace() - /e modifier is deprecated since PHP 5.5 and removed since PHP 7.0
       
    • Dan Haddock
      By Dan Haddock
      DMS: Latest Version
      Running a Child Theme
      Wordpress: 4.8.3
      Plugins:
      Akismet Anti-Spam 
      Coming Soon Page & Maintenance Mode by SeedProd
      Contact Form 7
      Cookie Law Info
      DMS Professional Tools    
      Enhanced Media Library
      Flamingo
      Google Analytics for WordPress by MonsterInsights
      Google XML Sitemap    
      Jetpack by WordPress.com
      Legull
      Loginizer   
      MailChimp for WordPress
      PageLines Updater
      Really Simple SSL
      Schema App Structured Data
      Sucuri Security - Auditing, Malware Scanner and Hardening  
      Uber reCaptcha
      Yoast SEO
      Problem Below
      Hi Team,
      I am looking to style the Continue Reading Button with the PHP you provided in an earlier ticket here: 
       
      I put the PHP code into my site, however I do not get my Icon back, I just get back Read More >>
      I have attached a screenshot of the code in place on my site along with the output.
      Interested to know what I may be doing wrong? - I am very new to PHP so a bit apprehensive on this.
      The Images: https://drive.google.com/open?id=0B0i4JJXa2jdQN2xoakZNRUdmaU0
      Let me know if you need any more information from me.
       
    • Paul
      By Paul+
      I was surprised to see I had no menu today - out of the blue - its actually moved to the bottom of the page!  After hours of fiddling and disabling every single plugin, leaving just plagelines the issue is still present.  See video for a basic text box - I moved it into the head and it jumps to the bottom and shows just above the footer but below the main content.  I have a temp fix by placing the menu into the first row on the main content but it does mean other than my home page, all other pages have no menu.  A quick fix is very urgent for this bug.
      https://thelaptopfixers.com
       
       
    • russe-intensif
      By russe-intensif+
      Hi team,
      checking my site today, i'm surprised to see my MegaNav all in bottom of the pages, while it's in header.
      After getting to change it in couple of pages onto Template part (too time consuming !), i'm desperate and ask you for help :-)
      apprendre-le-russe-avec-ania.fr
      Thank you in advance !

    • flourishdesignstudio
      By flourishdesignstudio+
      Hello,
      I have an older site that was built using PageLines several years ago (prior to the release of DMS). I wanted to leverage some of the power of your new PL5 plugin but the theme prevents be from adding any generated custom sidebars to the theme (through the drag and drop interface) and does not allow me to add any PL5 sections/containers/etc to the header or footer. Is there any way to easily override that or am I stuck only using PL5 in the content areas of the site?
      Thanks so much for the help!
×