WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. jdank
    Member
    Posted 4 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:
    http://www.solar-sell.eu/documenten-database/

    http://wordpress.org/plugins/wck-custom-fields-and-custom-post-types-creator/

  2. madalin.ungureanu
    Member
    Plugin Author

    Posted 4 months ago #

    Hi,

    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
    Member
    Posted 3 months 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!

Reply

You must log in to post.

About this Plugin

About this Topic