Skip to toolbar

Books & Author List

This template is for a custom post type called “author” with a field called “books” that is a related to the custom post type “book”. It uses a conditional test to check if the author has any books, and if it does not it outputs the message “Author has no books uploaded.”. If the author does have books it outputs information from each of the related books, starting with the post title. Then it loops through the field “cover_images”, which is in the “book” custom post type. Inside of the loop, the [once] block is used to add an additional class to the first item only. If this template itself is looped the wrapping will contain all items and not be repeated.

Table of Related Items