WCK - Custom Post Types and Custom Fields Creator
How do I get the attachment url? - Function reference (3 posts)

  1. jdank
    Posted 2 years 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:


  2. madalin.ungureanu
    Plugin Author

    Posted 2 years ago #


    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. jdank
    Posted 2 years ago #

    @madalin: Thanks! It's working now.
    I was searching for this: <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?

    Thanks in advance!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WCK - Custom Post Types and Custom Fields Creator
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic