Support

Account

Home Forums General Issues Post navigation using relationship field

Helping

Post navigation using relationship field

  • Just now I’m using the relationship field to link artwork to an artist, when viewing the artwork I want there to be navigation, which cycles through the artwork under the same artist.

    Just now I have to create a category for the artist and add each piece of artwork to the specific artist category.

    Is there a way to use the relationship field to navigate between each artwork under a certain artist?

    Just now my code looks like this:

    <div class="navigation-prev">
    	<?php  previous_post_link('%link', '<img src="/images/left.png">', TRUE); ?>
    	</div><!-- End navigation prev -->
    
    	<div class="navigation-next">
    	<?php next_post_link('%link', '<img src="/images/right.png">', TRUE); ?>
    	</div><!-- End navigation next -->
  • Hi @stevenharris

    Currently, your data setup is showing 1 artwork per page. Another way to do this would be to use the repeater field to add multiple images to 1 artist page.

    Hopefully, ‘artist’ is a post type and you can then create 1 artist called ‘John’ and his images to his post through the repeater field.

    Then on the template, you could render out these images however you want. Perhaps a gallery, slider, lightbox?

    Does this help?

    Thanks
    E

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Post navigation using relationship field’ is closed to new replies.