Support

Account

Home Forums General Issues Help needed with displaying images on the front-end.

Helping

Help needed with displaying images on the front-end.

  • Hi there.
    I am new to ACF, but after following the docs, my images are showing as broken images.
    I have posted a screenshot and supply code below.
    Any help much appreciated.

    As you can see in screenshot: Link

    here is my code.

    
    <?php
    /**
     * The template for displaying all pages
     *
     * This is the template that displays all pages by default.
     * Please note that this is the WordPress construct of pages
     * and that other 'pages' on your WordPress site may use a
     * different template.
     *
     * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
     *
     * @package base
     */
    
     
    
    get_header();
    ?>
    
    	<main id="primary" class="site-main">
    
    		<?php
    		while ( have_posts() ) :
    			the_post();
    			
    			
    			?>
    			<img />" />
    				<?php
    			
    			
    			
    			
    
    			get_template_part( 'template-parts/content', 'page' );
    
    			// If comments are open or we have at least one comment, load up the comment template.
    			if ( comments_open() || get_comments_number() ) :
    				comments_template();
    			endif;
    
    		endwhile; // End of the loop.
    		?>
    
    	</main><!-- #main -->
    
    <?php
    get_sidebar();
    get_footer();
    

    please help 🙂
    Thank you.

  • You should be making your changes in the file template-parts/content-page.php inside of the have_posts() loop in that template.

    
    get_template_part( 'template-parts/content', 'page' );
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.