• Resolved gbenoit

    (@gbenoit)


    Hi,

    On my site I have 3 headers, 1 general for most pages, 1 for English pages, 1 for registered users pages. Currently my problem is that the general header is displayed at the pages of registered users. It is a big problem because the access to many pages is only done via the registered user header, which don’t display anymore.

    The trouble happened today, after I made some changes in the general header content, and in the WP-Member plugin (I stopped it).

    I have tried to switch again the WP-member plugin, but it doesn’t help.

    Can anyone explain me what should I check to be sure that my pages get the correct header ?

    KR

    Benoit

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator bcworkz

    (@bcworkz)

    Try checking your PHP error log for clues about why your header logic is failing to work as expected.

    Also examine your theme’s header.php file to learn how it decides what header to show. For example, does it use is_user_logged_in() to decide to show the registered user header? Somehow, the information the code depends upon is not available when needed. You need to know what the code is trying to use in order to determine why it is not right.

    Thread Starter gbenoit

    (@gbenoit)

    Thanks for your advice.

    I search on my header_user.php file, before (when it appeared correctly) and now (when it doesn’t appear). I don’t understand most of the language, but searching for “user” keyword”, I found this : <meta name=”viewport” content=”width=device-width,initial-scale=1,user-scalable=no,maximum-scale=1,minimum-scale=1″>. But the text was same for both files.

    Here belove is my header_user.php file :
    https://nippon-lens.co.jp/wordpress/wp-admin/theme-editor.php?file=header_user.php&theme=tpl
    But I guess this link in on my WP admin site so need password. Here below is the header_user.pho file full text. Can anyone check for me where is determine to which user the header is shown ?

    <!doctype html>
    <html lang="ja">
    <head>
    	<!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-125337467-1"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
    
      gtag('config', 'UA-125337467-1');
    </script>
    	<meta charset="utf-8">
    	<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no,maximum-scale=1,minimum-scale=1">
    	<meta name="description" content="">
    	<title></title>
    	<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    	<link href="<?php bloginfo('template_url'); ?>/css/reset.css" rel="stylesheet" />
    	<link href="<?php bloginfo('template_url'); ?>/css/style.css" rel="stylesheet" />
    	<link href="<?php bloginfo('template_url'); ?>/css/sp.css" rel="stylesheet" />
    	<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.css">
    	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
    	<script src="https://cdnjs.cloudflare.com/ajax/libs/wow/1.1.2/wow.min.js"></script>
    	<script src="https://cdnjs.cloudflare.com/ajax/libs/object-fit-images/3.2.3/ofi.js"></script>
    	<script src="<?php bloginfo('template_url'); ?>/js/respond.src.js"></script>
    	<script src="<?php bloginfo('template_url'); ?>/js/common.js"></script>
    	<?php if ( is_home() || is_front_page() ) : ?>
    	<script src="<?php bloginfo('template_url'); ?>/js/top.js"></script>
    	<?php else: ?>
    		<script src="<?php bloginfo('template_url'); ?>/js/SecondImg.js"></script>
    	<?php endif; ?>
    	<?php wp_head(); ?>	
    </head>
    <body>
    	<!-- header -->
    	<header class="fixed">
    		<div class="tel sp_none">
    			<ul>
    				<li><a href="tel:0724232421"><i class="fa fa-phone" aria-hidden="true"></i> 072-423-2421</a></li>
    				<li class="lang"><a>/en"><i class="fa fa-caret-right" aria-hidden="true"></i> English</a></li>
    				<li class="lang">
    					<a>/legacy"><i class="fa fa-caret-right" aria-hidden="true"></i> 旧サイト
    					</a>
    				</li>
    			</ul>
    		</div>
    		<div class="tagline clearfix">
    				<div class="fb sp_none">
    					<a href="https://www.facebook.com/Nipponlens/" target="_blank" rel="noopener noreferrer"><img />/img/fb.png" alt="facebook"></a>
    				</div>
    			
    			<div class="logo">
    				<a>/"><img />/img/logo.png"></a>
    				<p class="">眼鏡レンズメーカー / 日本レンズ工業株式会社</p>
    			</div>
    		</div>
    		<nav class="nav sp_none" id="pc_nav">
    			<ul class="user">
    				<li><a>/user_top">眼鏡店専用サイトトップ</a></li>
    				<li><a>/specification">レンズ仕様</a></li>
    				<li><a>/schedule">納期表</a></li>
    				<li><a>/price">当店価格表</a></li>
    				<li><a>/pop">販促資料</a></li>
    				<li><a>/partner">ビジョンケアパートナークラブ</a></li>
    			</ul>
    		</nav>
    	</header>
    
    	<div class="pc_none">
    		<div class="sp_tel pc_none"><a href="tel:0758413031"><i class="fa fa-phone" aria-hidden="true"></i></a></div>
    		<div id="nav-drawer">
    			<input id="nav-input" type="checkbox" class="nav-unshown">
    			<label id="nav-open" for="nav-input"><span></span><span></span><span></span></label>
    			<label class="nav-unshown" id="nav-close" for="nav-input"></label>
    			<div id="nav-content">
    				<div class="box">
    					<ul>
    						<li><a>/user_top">眼鏡店専用サイトトップ</a></li>
    						<li><a>/specification">レンズ仕様</a></li>
    						<li><a>/schedule">納期表</a></li>
    						<li><a>/price">当店価格表</a></li>
    						<li><a>/pop">販促資料</a></li>
    						<li><a>/partner">ビジョンケアパートナークラブ</a></li>
    					</ul>
    				</div>
    			</div>
    		</div>
    	</div>
    </header>
    <!-- header -->
    • This reply was modified 5 years, 8 months ago by bcworkz. Reason: code fixed
    Thread Starter gbenoit

    (@gbenoit)

    Maybe my problem comes from the fact I stopped the WP-Members plugin ? I tried to switch it again and so not effect, but due to some cookies or things like that, despite I try and clean all my navigation data, the changes I make in WP takes always long time to show up on the site.
    Anyway my will is to keep stopped the WP-Members plugin and still get the header_user.php correctly display on specific pages.

    Moderator bcworkz

    (@bcworkz)

    User roles and capabilities set by any “member” sort of plugins should persist without the plugin active, so your goal in theory should be possible. However, if any remaining custom code relies upon functions or classes declared by the plugin, that code will of course fail.

    The file contents you posted is straight HTML, there is no programmatic logic in PHP being used there to decide anything. Any logic would have to come from the template file loading header_user.php. In that file, such logic would be contained within <?php ?> delimiters. It’s possibly in header.php, but I’m guessing as I am unfamiliar with your theme.

    There is a small chance some of the JavaScript loaded is determining the content displayed, but since JavaScript runs in the client browser and not on your server, it’s very unlikely.

    Because I’m unfamiliar with your theme, the help I can provide is limited. You would be better served asking for assistance through your theme’s official support channel dedicated to that theme only. The WP forums here are mainly for support of the WP software itself, plugin and theme support is provided by the individual developers of each module. Sorry to give you the run around. I was hoping that pointing you in the right direction would be enough help, but that does not appear to be the case any longer.

    A couple things to keep in mind for the next time you post in these forums: Please refrain from posting large blocks of code. Use a service like pastebin.com for that. When you do post any code snippet here in the forums, please demarcate with backticks or use the code button. Failure to do so corrupts your code and can also corrupt the display of your topic.

    Thread Starter gbenoit

    (@gbenoit)

    Thanks for the advice reg Theme support channel, I will check this. Thanks also a lot for the way to show code in WP forum topic in a proper way. Being very new to this, such nicely explained advices are precious to me. Thx a lot.

    Moderator bcworkz

    (@bcworkz)

    You’re welcome. At least I helped in some small way even if I could not solve your issue ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Wrong header displayed’ is closed to new replies.