• This is one of the oddest issues I’ve ever run into.

    I’ve created an custom post type for top of the page alerts and placed the WP_Query call in my header.php template. It correctly displays on all pages except on a tag archive page. On tag archive pages, it pulls the query data from the advanced custom fields database fields. I’ve double checked the archive.php, custom post archive template, created a tag archive template and none of it seems to affect this issue.

    For example on every page other than the tag archive page the WP_Query code renders like this:

    <!-- ALERTS Start -->
    <div id="alert-153" data-alert class="header-alert-box">
    	<a href="http://example.com/ahpba-2015/">Click here to view 2015 AHPBA Lecture Recordings</a>
    	<a href="#" class="close">×</a>
    </div>
    <!-- ALERTS End -->

    But on the tag archive pages it renders like this:

    <!-- ALERTS Start -->
    
    <div id="alert-214" data-alert class="header-alert-box">
    
    	<a href="#" class="close">×</a>
    </div>
    
    <div id="alert-211" data-alert class="header-alert-box">
    
    	<a href="#" class="close">×</a>
    </div>
    
    <div id="alert-202" data-alert class="header-alert-box">
    
    	<a href="#" class="close">×</a>
    </div>
    
    <div id="alert-201" data-alert class="header-alert-box">
    
    	<a href="#" class="close">×</a>
    </div>
    
    <div id="alert-203" data-alert class="header-alert-box">
    
    	<a href="#" class="close">×</a>
    </div>
    
    <div id="alert-208" data-alert class="header-alert-box">
    
    	<a href="#" class="close">×</a>
    </div>
    
    <div id="alert-209" data-alert class="header-alert-box">
    
    	<a href="#" class="close">×</a>
    </div>
    
    <div id="alert-210" data-alert class="header-alert-box">
    
    	<a href="#" class="close">×</a>
    </div>
    
    <div id="alert-48" data-alert class="header-alert-box">
    	a:7:{s:4:"type";s:3:"url";s:12:"instructions";s:0:"";s:8:"required";i:0;s:7:"wrapper";a:3:{s:5:"width";s:0:"";s:5:"class";s:0:"";s:2:"id";s:0:"";}s:13:"default_value";s:0:"";s:11:"placeholder";s:25:"https://vine.co/u/USER_ID";s:17:"conditional_logic";a:1:{i:0;a:1:{i:0;a:3:{s:5:"field";s:19:"field_54e3e971d7882";s:8:"operator";s:2:"==";s:5:"value";s:4:"Vine";}}}}
    	<a href="#" class="close">×</a>
    </div>
    
    <div id="alert-56" data-alert class="header-alert-box">
    	a:7:{s:4:"type";s:3:"url";s:12:"instructions";s:0:"";s:8:"required";i:0;s:7:"wrapper";a:3:{s:5:"width";s:0:"";s:5:"class";s:0:"";s:2:"id";s:0:"";}s:13:"default_value";s:0:"";s:11:"placeholder";s:28:"https://medium.com/@USERNAME";s:17:"conditional_logic";a:1:{i:0;a:1:{i:0;a:3:{s:5:"field";s:19:"field_54e3e972d7883";s:8:"operator";s:2:"==";s:5:"value";s:6:"Medium";}}}}
    	<a href="#" class="close">×</a>
    </div>
    
    <!-- ALERTS End -->

    This makes no sense to me, and I’m completely at a loss. I’ll happily provide any info anyone might want, does anyone have any ideas on how to fix it?

  • The topic ‘WP_Query Displaying Data Wrong on Tag Archive Pages’ is closed to new replies.