Support

Account

Forum Replies Created

  • UPDATE: I posted this tread on stackoverflow.com and someone suggested that it was a database issue (which I’m betting you were arriving at, Elliot) so I dropped all old live db’s and imported my local one and everything works just fine now.

    Thanks for your help!

  • Alright, I’m a little confused but I’m pretty sure my “Hello World” post ID should be 1.

    When I enter this /?attachment_id=1 to my sites URl, I get my post.

    When I add 1078, however, I get this garbage..

    I’m hoping this gives some insight?

  • Hi Elliot,

    I just var_dumped $post_id = get_the_ID(); and it returns int(1078)

    I have no idea what that could mean.

    Shouldn’t I be expecting the post name as my id?

    Also, thanks for taking an interest in my issue.

  • I just vardumped all of the variables I set to determine if content exists or not:

    $statementTrue = get_field( "statement" );
    $galleryTrue = get_field("image_gallery");
    $videoTrue = get_field("video_content") && get_field("video_embed");
    $poetryTrue = get_field("poem_1");

    And I got the correct data for statement and gallery but false on the other two.

    I doubled checked that the content was posted and that the field names were correct, they were posted and the names are right.

    EDIT: I also checked for get_field(“video_content”) and get_field(“video_embed”) separately. They both returned false.

    The only way I could get ACF post data to display was to include only the $statementTrue variable. Adding the gallery variable broke it again even though it gave me my content when I vardumped.

  • Below is the code for posts page. The ‘Hello World’ post has dummy content in each field and has been posted and updated multiple times.

    I know it looks like I left out the content and what’s weirder is, while video and poetry content do exist, their tabs are non existent unlike the state and gallery tabs. But while those tabs exist, they’re empty even though there is post data submitted for each content type.

    I don’t have any caching plugins installed, could there be a caching setting set by my hosting service by default? I host with ipage.com if that helps.

    <?php 
    get_header();
    $idObj = get_category_by_slug('category-name'); 
    $id = $idObj->slug;
    $ftimg = wp_get_attachment_url( get_post_thumbnail_id($post->ID));
    $statementTrue = get_field( "statement" );
    $galleryTrue = get_field("image_gallery");
    $videoTrue = get_field("video_embed");
    $poetryTrue = get_field("poem_1");
     ?>
    
    <div id="single">
    
    	<?php if(have_posts()) : while(have_posts()) : the_post(); ?>
    		
    		<div id="tabs">
    			
    			<section class="post-title" style="background-image: url(<?php echo $ftimg; ?>); background-size: cover; background-position-y: 50%;">
    				<div id="titleoverlay">
    					<h1 class="titles title"><?php the_title(); ?></h1>
    				</div>
    				<?php include("includes/tabnav.php"); ?>
    			</section>
    			
    		<?php if ( $statementTrue == true ) : ?>
    		
    		  <div id="statement-tab">
    	
    		    <?php get_template_part('content', 'statement'); ?>
    		    
    		    <div id="social-footer">
    		    	<?php include('includes/social-footer.php'); ?>
    		    </div>
    		    
    		  </div><!--end statement-tab-->
    		  
    		<?php endif; ?>
    		
    		<?php if ( $galleryTrue == true ) : ?> 
    		 
    		  <div id="gallery-tab">
    		   
    		    <?php get_template_part('content', 'gallery'); ?>
    		    
    		    <div id="social-footer">
    		    	<?php include('includes/social-footer.php'); ?>
    		    </div>
    		    	
    		  </div><!--end gallery-tab-->
    		  
    		<?php endif; ?>
    		
    		
    		<?php if ( $videoTrue == true ) : ?>	  
    	
    		  <div id="video-tab">
    		    
    		    	<?php get_template_part('content', 'video'); ?>
    		    	
    		    	<div id="social-footer">
    		    		<?php include('includes/social-footer.php'); ?>
    		    	</div>
    		    	
    		  </div><!--end video-tab-->
    		  
    		<?php endif; ?>
    		  
    		<?php if ( $poetryTrue == true ) : ?>
    		  
    		  <div id="poetry-tab">
    		    
    		  	<?php get_template_part('content', 'poetry'); ?>
    		    
    		  </div><!--end-poetry tab-->
    		
    		<?php endif; ?>
    		
    		</div>
    		
    		
    	<?php endwhile; else: ?>
    	
    		<p class="noposts">Nope. No posts. single.</p>
    
    	<?php endif; ?>
    		
    <?php get_footer(); ?>
    
    </div>
Viewing 6 posts - 1 through 6 (of 6 total)