Previous and Next link article
-
Hi,
I’m using WordPress for a short time. I’m trying to modify view of previous and next article in an article. In my website there’s a section “portfolio” and I’d like that when I am in project page (that’s article), in the bottom page I visualize link, image and title of prev and next article.
https://wordpress.stackexchange.com/questions/178780/next-and-prev-post-link-only-within-category
At this link it’s explained how visualizing prev and next post link within the same category, but I don’t know applying the same thing to image and title.
Shown below the code I have used:<div class="nav-box previous"> <div style="margin: 0 0 15px"> <?php if (!empty($prev_post)){ ?> "> <span class="meta-icon"><i class="fa fa-angle-left fa-lg"></i></span> Precedente <?php } ?> </div> <?php $prevPost = get_previous_post(); $prevthumbnail = get_the_post_thumbnail($prevPost->ID,array(80,97)); ?> <?php previous_post_link('%link',"$prevthumbnail <p>%title</p>", TRUE); ?> </div> <div class="nav-box next"> <div style="margin: 0 0 15px"> <?php if (!empty($next_post)){ ?> ">Successivo <span class="meta-icon"><i class="fa fa-angle-right fa-lg"></i></span> <?php } ?> </div> <?php $nextPost = get_next_post(); $nextthumbnail = get_the_post_thumbnail($nextPost->ID,array(80,97)); ?> <?php next_post_link('%link',"$nextthumbnail <p>%title</p>", TRUE); ?> </div>
Can anyone help me? Thanks.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Previous and Next link article’ is closed to new replies.