Support » Plugin: Custom Post Types and Custom Fields creator - WCK » How do I get the attachment url? – Function reference
3 years, 2 months ago
I have a “gallery” that contains posts from a category. The gallery is on the “download section” page. It displays all the thumbnails posts from the category “documents”.
With the WCK plugin I added a field to attach uploaded *.pdf files to the post.
What I want: When I click on one post in the gallery, it must link to the uploaded pdf file.
In the code within the loop, I try to call the url of the uploaded attachment in the following way:
<a href="<?php echo wp_get_attachment_link(); ?>"
But now the only link I get is : “missing attachment”.
Where can I find the correct code to get the link of my uploaded attachment?
Thanks in advance!
The url of the page:
Please check out this documentation page http://www.cozmoslabs.com/docs/wordpress-creation-kit-documentation/upload/ that details how to use the upload field.
3 years, 1 month ago
@madalin: Thanks! It’s working now.
I was searching for this: <img src="<?php the_cfc_field('my_meta_name', 'avatar'); ?>" />
<img src="<?php the_cfc_field('my_meta_name', 'avatar'); ?>" />
I now have an upload field for a specific post.
I configured it at the custom fields creator.
There is a field called “post id” under meta box arguments. I can fill in the ID of a post on which the meta box should appear.
How do I add this custom field to multiple posts? Or even better; add it to posts in a specific category?
I now have to fill in a specific ID of a post on which the meta box should appear. I want to know if it is possible to add the custom field to all posts by default, instead of one specific post?