Complete Code
<?php get_header(); ?>
<main id="news_posts">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<!-- Post -->
<section>
<div class="post">
<div class="area_news_post">
<h1 class="post-title">
<?php the_title(); ?>
</h1>
<div class="news_data">
<span>Date:
</span>
<?php the_time( 'd/m/Y') ?>
</div>
</div>
<div class="post-body">
<div class="images-post">
<?php
$attachments = get_posts( array(
'post_type' => 'attachment',
'numberposts' => 5,
'post_status' => null,
'post_parent' => $post->ID,
'order' => 'ASC',
) );
if ( $attachments ) {
foreach ( $attachments as $attachment ) {
?>
<?php echo wp_get_attachment_image( $attachment->ID, 'full' ); ?>
<?php echo apply_filters( 'the_title', $attachment->post_title ); ?>
<?php
$parent = wp_get_post_parent_id( $attachment->ID );?>
<a href="<?php esc_url( the_permalink( $parent) ) ?><?php echo $page ?>/">
<?php the_title ?>
</a>
<?php } } ?>
</div>
<?php the_content() ?>
</div>
<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . 'Page:' . '</span>', 'after' => '</div>' ) ); ?>
<?php $post_anicast_idurl = get_post_meta($post->ID, '_my_url_anicast', true);
if (!empty($post_anicast_idurl)) { ?>
<iframe width="100%" height="120" src="<?php echo $post_anicast_idurl; ?>" frameborder="0"></iframe>
<?php }?>
<div id="area_avatar_autor">
<div class="avatar">
<?php if (function_exists ( 'mt_profile_img' ) ) { $author_id=$post->post_author; mt_profile_img( $author_id, array('size' => 'thumbnail', 'attr' => array( 'alt' => get_the_author(),'title' => get_the_author() ),'echo' => true ));
}?>
</div>
<div class="author_post">
<span>By:
</span>
<?php the_author() ?>
</div>
<div class="views_post">
<span> Views:
</span>
<?php if(!current_user_can('administrator')){ echo setPostViews(get_the_ID()); } ?>
<?php echo getPostViews(get_the_ID());?>
</div>
<div class="share_post_link">
<span class="label share_bg">Share:
</span>
<input type="text" class="share_link" readonly="readonly" value="<?php echo wp_get_shortlink(); ?>">
</div>
</div>
<div id="share_social_tags">
<div class="social_share">
<a href="#" title="Facebook"> Facebook
</a>
<a href="#" title="Twiiter"> Twiiter
</a>
<a href="#" title="Google+"> Google +
</a>
</div>
<div class="tags_post">
<?php the_tags( ) ?>
</div>
</div>
<div class="post_edit">
<?php edit_post_link('Editar','',''); ?>
</div>
<!-- Navigation -->
<div class="navigation">
<div class="navigation-previous">
<?php previous_post_link( '%link',' « Anterior') ?>
</div>
<div class="navigation-next">
<?php next_post_link('%link', 'Próxima »') ?>
</div>
</div>
<!-- /Navigation -->
<div id="disqus_thread">
</div>
</div>
<!-- /Post -->
<?php endwhile; ?>
<?php else : ?>
<!-- Post -->
<div class="post">
<div class="post-top">
<div class="post-bottom">
<div class="post-title">
<h2> Not found
</h2>
</div>
<div class="post-entry">
<p> Nothing found. Come Back
</p>
</div>
<div class="post-info">
</div>
</div>
</div>
</div>
<!-- /Post -->
<?php endif; ?>
<div class="clear"></div>
</main>
</div>
<!-- /Main -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
I'm trying to add in the attachment loop url the wp_link_pages function but I did not succeed, my current url:
I've been trying for some time but I can not add wp_link_pages to the url attachment loop, I'd like it to look like this:
wp_link_pages()
?