Put this code in the top of your api page, it will call in the functions, but you need to tell wordpress NOT to try and draw a page as well
define('WP_USE_THEMES', false); // Tell wordpress not to draw out a page
require('/path/to/public_html/wp-load.php'); // load wordpress functions
Related Posts:
- Add multiple custom fields to the general settings page
- When should you, and when should you not, use wp_list_pluck()?
- Is it possible to remove the “standard” post format?
- Woocommerce add to simple product attribute programmatically [closed]
- Issue with get_theme_mod returning a blank value instead of the saved value
- How to remove row-actions from pages table?
- Modify search function in WordPress (TwentyTwelve)
- How to customize search result page title?
- Auto delete WordPress images/thumbnails (all sizes) and featured after X days/hours, or similar?
- How to fix a theme with page.php Default Template that accidentally deleted?
- Removing Unnecessary Text from Admin Menu without CSS
- Display WordPress Search
- How do I change parameters without changing the core
- Problem with extract() with custom shortcode
- How to add a rel attribute to images that contains their categories?
- add sidebar area to header of child theme
- Preferred Use of home_url()?
- Custom function for user register in wp?
- Theme-Config tab in admin Pannel?
- Creating loop within functions.php
- How to Add a Random Custom Gravatar in the WordPress Comments?
- creating shortcode to pull json array
- Refactor create_function
- adding custom classes for tables
- Pass Shortcode Attribute to footer Script
- How to mass-delete inline styles in WordPress custom post type automatically?
- Customizer field value into functions.php variable
- PHP files included in functions.php don’t seem to work
- How Can I Expand the WordPress Customize window without any Plugin?
- Set quantity of woocommerce product on page visit [closed]
- wp_dropdown_categories and custom attribute
- Automatically wrap multiple images in div
- Ajax not working properly
- is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript
- How to customly read JWPlayer’s “Playlist” items by using its “playlistid”?
- Hard-coding custom menu elements for menu manager
- How can I remove the main description text box in a Woocommerce product editor page? I only use the “Product short description” text box [closed]
- How can I modify all existing tags while keeping the urls themselves?
- Best practices regarding the creation of custom widgets?
- IF Statement on Button to make it complete and “uncomplete” based on user action / click
- Gravity Forms Button Text
- Find resources dynamically loading and change or add to the url
- When sale price is 0.00 show only regular price
- Unable to login using username
- Word Press – Dynamic Content [closed]
- how can I just add to parent theme function(s) instead of redeclaring whole the function
- Skeleton Child Theme Add Icon Bar to Header Flex Grid
- Condition OR for current user ID
- How to retrieve the current post’s generated featured image size?
- Define PHP variable from a seperate API if statement
- Custom Behavior when Adding New Custom Post Type in Dashboard
- Where do I store custom functions that call custom page template files?
- Why There Is No “get content by ID” Function
- Custom HTML markup
- Use a shortcode to display custom meta box contents
- Wp-query Order By problem
- Create custom function for hero image
- Randomizing wp_tag_cloud() in child theme
- How to append classname to body tag if guest user
- Where do I go to edit this area? [closed]
- Replace plugin function with a custom function?
- Problem with images URL after filter applying
- Function to replace comment’s accented characters before posting
- New checkbox in custom widget isn’t saving data
- Linking Javascript in functions.php file
- How to replace ACTION url from original wordpress login form?
- Save_post – Warning: Cannot modify header information
- How to use WP conditional tag in a functions.php with OCEANWP Theme?
- Modifying a WordPress Plugin
- CF7 select value get to function and reciept value from function
- Hide author info in single posts by certain users
- External api call and make global variable for any page visitor enters , page-home, page, single etc
- CSS style and app.js not loading
- Parent category as WOOCommerce Categories widget title
- I want to customize the_posts_navigation function by replacing prev and next with images
- How would I correctly implement a new if statement in a child functions file?
- Woocommerce custom calculation function
- Remove all video attachment, both files and post/postmeta from database?
- Is it possible to use ‘wp_insert_post’ function within a for loop?
- MCAPI.class.php showing some error
- True email confirmation for registration (keeping unvalidated users from user table)
- Replace image attributes for lazyload plugin on image elements with specific class
- How To Show Shortcodes In WordPress Custom Fields?
- How to make an If Else on Excerpt Filter
- custom post with loading script per single post
- Get Value of Custom Field
- restrict access to specific urls on a specific period of time
- child_of not working while searching
- How to request login for user but not for bots
- functions.php / replacing div’s with new ones?
- Post variables not displaying correctly in custom function
- Integrating custom API for post content into Admin interface & Public Website [closed]
- Removing Facebook contact field from user contact not working
- How do I add functionality to images?
- Problem with removing characters “<” – WpAllImport
- How to create a post without link in wordpress?
- How to crop image in WordPress with aspect ratio for any size of image
- multible shortcodes (for differnt values) with one function
- Customizer cuistom CSS Priority ordre Issue
- Copy and Modified WooCommerce function is_coupon_valid [closed]