Since it’s a standalone script, you can just link to it directly and WordPress will be none the wiser. Just make sure you get the link right – if it’s in your theme, it will be something like:
http://example.com/wp-content/themes/my-theme/generate-pdf.php
Don’t hardcode the URL though, use the available template functions:
<a href="https://wordpress.stackexchange.com/questions/199196/<?php bloginfo("template_url' ) ?>/generate-pdf.php">Generate!</a>
Of course if you want a “pretty” URL you can use the rewrite API.
Related Posts:
- How to print redirected query string variables to the page?
- wp_set_object_terms and arrays
- How to get the original price of the product in woocommerce?
- How to redirect users to custom lostpassword page?
- How to use WordPress (PHP) functions in AngularJS partials files?
- Can I write ‘RewriteCond’ using ‘functions.php’?
- How to add 2 posts under another post? Formatting should be intact
- Overriding a theme redux file in child theme
- Validate a users email address when using gmail to register
- Get widget settings function?
- enqueue multiple Google fonts with multiple weights and styles (italic)
- What is the fastest way to load PHP functions that are only used in one theme template?
- Adding tawk.to code just before body tag on functions.php file
- Can’t load WP function into external function
- Image as Sales Badge
- add_action shortcut?
- WSoD being caused by this piece of code
- How to Arrange PHP Files to Allow for Multiple Types of Pages?
- remove wp floating submenu in wp dashboard
- ACF: how do I get the fields and its values of a specific group?
- How to complete two other input fields, completed the first
- Get page that displays all children of taxonomy parent
- Function to capture a value and store it in a variable
- Adding a widget function into the php theme file
- My new button is in the wrong place
- Checking array against author id in loop
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- Scrape external webpage for first image and add it to new post
- Call to undefined method – Download Monitor
- How do I link a button I created in theme customizer to a function?
- How to change menu labels
- jQuery code not working when included in functions.php
- Fatal Errors on pluggable.php
- Log in / Log Out Custom Button
- How to obtain the current website URL in my theme?
- Remove Custom Divs from AMP pages
- Read array in php?
- Tell WP register script to load a script only when the entire page is loaded
- Can’t save php string to a custom field
- get_template_directory adding FTP root folders in urls
- Fatal error: Call to undefined function register_new_user()
- How to modify the default feed via a function
- Is it possible to display a DIV to not logged in users and then change it for users who are logged in?
- Remove extract from function
- Undefined offset: 3 in custom function
- Loop over Array and get the distinct ids
- How do I change this function from two returns to one string to show sku and dimensions in WooCommerce cart?
- Changing the order of custom fields in the dashboard for Woocommerce variable products [closed]
- Post not populating for custom post type based on category selection
- call_user_func_array() expects parameter 1 to be a valid callback, function ‘———-‘ not found or invalid function name
- Dynamic Menu drops pages?
- Aspx/Rss feed – failed to open stream: Redirection limit reached
- Adding an Unlinked Space in a Custom Function
- How do I call an external php non WordPress class into functions.php?
- send popup after wp_redirect()
- no_rest_route error on custom routes
- Can/should we delete wordpress cron jobs with no action?
- Database entry removed on browser refresh, Ajax PHP jQuery
- Checkbox doesn’t save inside metabox
- A function to get the content of a page
- Display Visual Composer shortcode if a post belongs in specific categories
- Add Featured Image to Existing Post
- How to get latest post ID in functions.php?
- Billing detail page doesn’t work after I’ve changed the order of the Woocommerce navigation
- How to use data URL in WordPress?
- Flushing the slug base has no effect and does not change
- How can I prevent a shortcode div from extending beyond its boundaries?
- Multiple cron jobs vs daily cron job doing multiple things? Which one yields better performance and scalability?
- Advance custom fields variable with if statement & Function
- JQuery modal not loading video on popup, only displaying it after multiple reopenings
- Get user by meta data key and velue
- Logo custom width not implementing
- Woocommerce textarea format ignored
- Add another role to a user when they click a button?
- Using wordpress functions in class and change my code to OOP PHP
- Printing OEmbed URL based on Post selected w/o page refresh
- Notice: Undefined index: post_title error
- Unable to pass arguments to function used in add_action
- What is the proper way to call a function (from functions.php) on a link click?
- Allow user to select location and then set cookie for location in WordPress
- Using Tag Groups: Displaying groups and adjacent tags of current post
- Page returning ID from array, how to return the correct values for post in acf wordpress
- Limit Taxonomy Parents
- WordPress HTML Helper
- List sibling pages widget, exclude current page
- Permission error on plugin save
- Removing all my hardcoded URLs with get_site_url()
- Display default WordPress login/registration form into a modal window
- Highlight main menu when on specific posts or pages
- How to add button to top of theme customizer?
- Pull GET parameter from URL in functions.php
- Adding Gravity Form With if(is_page) Is Not Working
- Send foreach $_post method to contact form 7 [closed]
- Options.php loop won’t show!
- Alternative to php echo within code
- Add multiple HTML attributes to an Elementor button
- Automatically change insurance quantity based on cart total [closed]
- /page/2/ redirect to 404
- How to pass value to add_filter wpcf7_form_tag from another function?
- hiddenQuestions.find is not a function