Follow below steps to create custom PDF upload field in custom post type:
- Install Advance Custom Field from wordpress.org
- Go to Custom Fields and click on Add New button.
- Follow instructions in below screenshot to add the custom field to upload PDF file.
-
Use below code to display content on post type template.
$pdf_file = get_field('pdf_upload'); if( $file ) { echo '<a href="'.$pdf_file.'">Download File</a>'; }
Reference Documentation: https://www.advancedcustomfields.com/resources/file/
Hope this helps..!!
Related Posts:
- Can I leave off plugin textdomain for terms used in core?
- Correct way to serialize the data of options table?
- How to force WordPress to temporarily switch locale (using qTranslate)? [closed]
- Custom admin column disappearing when using Quick Edit [duplicate]
- Create page when plugin is activated
- How can I translate the name of my Plugin for other languages?
- Article source link for posts
- How to make a plugin auto-add item to nav menu
- Logs to check when the plugin was first installed for the first time
- How to get custom field image url of specific size
- Getting “Fatal error: Call to undefined function wp_cache_get() in option.php” after updating a cache plugin [closed]
- Facebook Like Button On Individual Comments
- Keep user’s privileges on accessing contents in JSON response
- Displaying admin notice dynamically
- Get total number of comment of the posts written by an author
- How to Dequeue All WordPress Assets
- How to replace or display the special characters from JSON API plugin [closed]
- Output HTML only on individual post view
- How to make Http Request to a php file present in plugin directory of wordpress
- How to checkout the wordpress.org plugin repository?
- Plugin to host auctions on your site
- How can I add Expire headers to images?
- How to Delete all Unused photos Function
- Inserting above the comment template
- All Users > User List > Update User Meta Field Inline
- List Category Posts rewrite necessitates rewrite of customised templates
- Moving Share Buttons from a Plugin
- How to check current user before all actions and filters?
- How do I create a filter feature on WordPress? [closed]
- What keys are needed when passing the icons array to plugins_api()?
- Customizing NEXTGEN Gallery To link images to pages
- Plugin: register_deactivation_hook works perfectly well, while register_activation_hook suddenly stopped working
- Load external images via proxy
- create link/button to purge cloudflare cache on post
- Ability to automatically redirect a URL
- Passing Page ID used in Meta Box Creation to JavaScript
- How to Add Custom New Published Post Counter Icon on Top of the WordPress Site [closed]
- Co-Authors Plugin Displaying Wrong Author
- Implementing an image hosting website using WordPress? [closed]
- WP-DownloadManager – Query most download per week/month etc
- Plugins ignored a line breaks or tag in the WordPress comment functions
- How to get path or root of plugin folder, not file or dir?
- Displayed content disappears when adding attributes to shortcode
- Thesis 2 custom Page
- What is the easiest way to rename a plugin (and also avoid plugin updates)
- Display linked articles at the bottom of post (like related posts)
- register_activation_hook() not working as expected
- Plugin not working & permalink erorr after upgrade to php 7x on Nginx
- Is there a way to remove a tooltip of a plugin via custom CSS? [closed]
- Correct Plugin File Path
- WordPress plugin boilerplate table create
- how to replace hostnames on certain external links?
- Custom PHP Page Using WordPress login
- Create “new pages” within the admin section of plugin
- How to completely hide a WordPress/BuddyPress Install? [closed]
- Facebook ‘Share’ and ‘Like’ on individual posts
- Creating teams of users in WordPress
- Creating a plugin that will display text on every page
- Share plugins, themes, and multi post in a multidomain network
- Removing the custom_image_header from wp_head
- Is it safe to use Web Invoice 2.1.0 without SSL?
- WordPress cron job running more than once
- How to properly replace the_content with the html in a php file?
- Is there a way to make [Table Of Content] plugin while not using revision data?
- How to display emails as a post?
- How to access a wordpress plugin page or add posts without doing it from the WordPress dashboard?
- Update wordpress user roles not working as excepted
- Displaying all the images from all of my articles
- Problem with Date translation in WordPress
- install / update plugins remotely
- Can’t access 3rd party API, code works on local server but not on wordpress
- Why is my site still showing insecure icon even if I have SSL certificate?
- Forum creation with bbpress and front end
- Fatal error when activating my custom wordpress plugin
- Front End Page Not Loading Header Footer
- Media Upload to custom database and Custom Directory
- TinyMCE how to add css when inputing a text
- Add image to post
- get_option return incorrect values
- avi mp4 flv video player [closed]
- get recent 12 days post then random in wordpress
- Restore Category Base
- Many Field in Front End User Registration form insert as post
- private functions in plugins
- Is it possible Embed flexviewer in wordpress and how?
- Need to change contact email depending where user is from
- How to show an image popup when one clicks on an image thumbnail?
- Include subtitle display to slideshow
- Custom Post Type – Permalink Problem
- Woocommerce – Product Description heading [closed]
- wp doesn’t recognize my plugin if I don’t login as WP user (or as WP Admin)
- How to make wordpress backend mobile optimized.?
- Possible to add “Template” selector to pages? Is Any Plugins are There..?
- WordPress REST API filter on blank custom ACF
- How to change and edit users according to the extension in the URL
- How to add a static image inbetween the product tiles on main shoppage woocommerce?
- Plugin download link
- thumbnail_width not working in wordpress most popular post plugin
- Gravity Forms and Gravity View Permissions
- Woocommerce attatch files and custom input meta to cart items and then to order
