I am trying to get an image with the image of the alt page and repeat it as paragraph text, but my code does not seem to work.
Currently I can echo the image and it works great.
Here is the code I'm using:
<?php
get_header(); ?>
</div>
<?php ?>
<?php while ( have_posts() ) : the_post(); ?>
<div class="header-image">
<?php echo get_the_post_thumbnail($page->ID, 'full'); ?>
<?php $alt = get_post_meta( $attachment_img->ID, '_wp_attachment_image_alt', true ); ?>
<p><?php echo $alt; ?></p>
</div>
source
share