My client has a few posts that contain a downloadable file. With these posts, she would like to replace the "read more" button that leads to the post URL with a "download" button that leads to the download file.
So I added a custom file upload field for posts, and a category "download". Now, I want to display a download button that links to the downloadable file in the post loop, but only for the posts in the download category.
Thank you for getting in touch. Can you let me know if you are using the classic view editor or if you're using the Blocks editor. Secondly do you want all this to be done with one view ?
We can make use of the conditional statements to check if a post has the taxonomy term assigned so please letme know.
Thanks,
Shane
I use the blocks editor, and yes, I would like this this to be done with one view. I already tried to use the conditional block, but I don't see a way to set a category as a condition.
Thanks Shane. I don't have the "post taxonomies" option in the dropdown, but I could get it to work with your shortcode. It does say "incomplete condition" though. When I enable debug mode, I get the following. I also need a code to hide the read more button on those categories, and I would like to have the download file open in a new tab.
Of course, you're more than welcome to login on the site.
I removed the query filter from the view just so that it can display the items for testing purposes. I had to re-do the conditional queries and it resolved the issue.