• I’m not a php expert and I need a help.

    I created a page with some custom field values using ACF. It worked fine until I added a blog posts to the page. Now custom field values disappeared. If I remove the blog section, they appear again. Can anyone help me on this issue?

    Here is the code for the entire page.

    <?php
    /*
    Template Name: XXXXXX
    */
    ?>
    <?php get_header(); ?>
    
    	<div id="content">
    
    		/* Page post */
    		<section id="home-lt">
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<div class="post" id="post-<?php the_ID(); ?>">
    			<h1><?php the_title(); ?></h1>
    			<div class="entry">
    				<?php the_content(); ?>
    			</div>
    			<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
    		</div>
    		<?php // comments_template(); ?>
    		<?php endwhile; endif; ?>
    		</section>
    
    		/* Blog loop */
    		<section id="home-rt" class="whatsnew">
    			<h2>What's New</h2>
    		<?php query_posts("post_per_page=5"); ?>
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    		<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    			<?php include (TEMPLATEPATH . '/inc/meta.php' ); ?>
    			<h3><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3>
    		</div>
    		<?php endwhile; endif; ?>
    		</section>
    
    	</div>
    
    	<div id="btm-navi-wrap">
    		<div id="btm-navi">
    			<ul>
    				/* Custom Field values */
    				<li><a href=""><img src="<?php the_field('menu1pic'); ?>" /><p><?php the_field('menu1txt'); ?></p></a></li>
    				<li><a href=""><img src="<?php the_field('menu2pic'); ?>" /><p><?php the_field('menu2txt'); ?></p></a></li>
    				<li><a href=""><img src="<?php the_field('menu3pic'); ?>" /><p><?php the_field('menu3txt'); ?></p></a></li>
    				<li><a href=""><img src="<?php the_field('menu4pic'); ?>" /><p><?php the_field('menu4txt'); ?></p></a></li>
    				<li><a href=""><img src="<?php the_field('menu5pic'); ?>" /><p><?php the_field('menu5txt'); ?></p></a></li>
    				<li><a href=""><img src="<?php the_field('menu6pic'); ?>" /><p><?php the_field('menu6txt'); ?></p></a></li>
    			</ul>
    		</div>
    	</div>
    
    <?php get_footer(); ?>
  • The topic ‘Advanced Custom Field problem’ is closed to new replies.