Site logo

Archived topic

Weird Issue - Admin Bar Not Appearing On Some Pages?

9 replies · Started by Dave on February 16, 2017

Viewing posts 1–10 of 10

Hi Folks,

I'm having a really weird issue - the admin bar (WP's built-in) appears on some pages but not on others. The pages it doesn't appear on appear to be related to taxonomies, e.g.:
http://www.philcata.com/offering_category/wordpress/

Most other pages seem to work fine.

I've taken a few troubleshooting steps already...

*Disabled my hosts caching
*Disabled CloudFlare's caching
*Disabled all plugins (I've reenabled now ACF Pro and CPTUI)
*Removed my custom template for the taxonomy so that it uses the default GP taxonomy template
*Tried another browser

And probably a few others I've forgotten now...

To add one more weird item into the mix, this page has the admin bar:
http://www.philcata.com/offering_category/
but as noted above, this one does not:
http://www.philcata.com/offering_category/wordpress/

Any ideas are greatly appreciated. BTW: I've tried most of those "here are five things you can do to fix your admin bar" articles. :)

Hmm, hard to tell as I'm not logged in and can't see the admin bar.

Usually this happens when there's an invisible PHP error towards the bottom of the page before the admin bar HTML in printed. Maybe check your error_log file?

I compared the source code from
philcata.com/offering_category/
and
philcata.com/offering_category/wordpress/

And you can definitely see that a huge chunk of code is missing, the latter page ends with:

<script type='text/javascript' src='http://www.philcata.com/wp-content/themes/generatepress/js/navigation.min.js?ver=1.3.44'></script>
<script type='text/javascript' src='http://www.philcata.com/wp-content/themes/generatepress/js/dropdown.min.js?ver=1.3.44'></script>
<!--[if lt IE 9]>
<script type='text/javascript' src='http://www.philcata.com/wp-content/themes/generatepress/js/html5shiv.min.js?ver=1.3.44'></script>
<![endif]-->
<script type='text/javascript' src='http://www.philcata.com/wp-includes/js/wp-embed.min.js?ver=4.7.2'></script>
</body>
</html>

The first one continues on:

	<!--[if lte IE 8]>
		<script type="text/javascript">
			document.body.className = document.body.className.replace( /(^|\s)(no-)?customize-support(?=\s|$)/, '' ) + ' no-customize-support';
		</script>
	<![endif]-->
	<!--[if gte IE 9]><!-->
		<script type="text/javascript">
			(function() {
				var request, b = document.body, c = 'className', cs = 'customize-support', rcs = new RegExp('(^|\\s+)(no-)?'+cs+'(\\s+|$)');

						request = true;
		
				b[c] = b[c].replace( rcs, ' ' );
				// The customizer requires postMessage and CORS (if the site is cross domain)
				b[c] += ( window.postMessage && request ? ' ' : ' no-' ) + cs;
			}());
		</script>
	<!--<![endif]-->
			<div id="wpadminbar" class="nojq nojs">
(rest of code for wp-admin)
</body>
</html>

I'll keep digging...thanks for the help.

No problem - your error_log file should provide some good insight on what's going on.

Strangely enough, the error_log didn't have anything useful! Not sure if this has to do with error logging levels with my host...

In any case, I ended up doing a compare of a fresh download of GeneratePress against my version. Remember how I was trying to add a list of CPT taxonomy categories?trying to add a list of CPT taxonomy categories?

The code I ended up using I added to the end of functions.php:

function show_offering_categories() {
    $terms = get_terms( array(
        'taxonomy'      => 'offering_category',
        'hide_empty'    => 1, // Yes
        'parent'        => 0, // Only top-level terms
    ) );
    $content = '<div class="offer_cats"><ul>';
    foreach ( $terms as $term ) {
            $content .= "<li><a href='http://www.philcata.com/" . $term->taxonomy . "/" . $term->slug . "/'>" . $term->name . "</a></li>";
    }
    $content .= '</ul></div>';
    return $content;
}
add_shortcode( 'offeringcat', 'show_offering_categories' );

Apparently this was the culprit...Though I am still working on figuring out why this would cause an issue.

Hmm, not seeing anything immediately obvious. Is your error_log set up correctly? Maybe check with your hosting just to make sure.

I know this is an old post but it has started for me. My home page the admin bar is missing and several others but not all of them. I also use Beaver Builder. None of this started until yesterday and the only plugin I added or updated has been deactivated and nothing changed back. Any suggestions???

Hi there,

Can you try disabling all non-GP plugins and see if we can find the problem?

If not can you check the error_log?

Sorry Leo, I tried that with zero success. However, now the problem seems gone. I do not understand what is going on. I have had weird issues for days.

Thank you for answering.... I am going to jump of a cliff! not really.. figuratively!

No problem :) Check the error_log if it happens again.

This archived topic is closed to new replies.