bigabyte
Forum Replies Created
-
Edit: I forgot to mention the other main aspect I need to take care of…
Atm I’ve build the WordPress site this way:
The index page is displaying the list of my client’s works (books) through a loop of a custom post type.
Each book/post links to its single page, which is defined through a “single-book.php” template file.What I’d really like to do would be attaching a PDF file to each custom post and adding a shortcode to the single-book.php file which would take the PDF file attached to the post and use it as its source. Every other setting would be identical for each book…
Do you think it would be possible to achieve something like this? Would you suggest other workarounds?
So far the only idea that came to my mind would be:
1. create a FlipBook for each books
2. add an ID field to the custom posts
3. manually fill each post’s “ID field” with the corresponding ID generated by the FlipBook plugin
4. add something like this inside the loop of the single-book.php file to dynamically set the shortcode’s ID:
<?php
$bookID = get_field( ‘book_id’ , $post->ID );
echo do_shortcode(“[3d-flip-book mode=\”fullscreen\” urlparam=\”fb3d-page\” id=\”$bookID\” title=\”false\” template=\”short-white-book-view\”]”) ?>This solution should work but I’m always looking for the cleanest ways ;D
I hope I’ve been clear enough.
Thank you in advance for you help!- This reply was modified 7 years, 9 months ago by bigabyte.