Is there a specific reason you’re trying to do this outside of WordPress the normal way? If there is, you could do include('wp-load.php')
to access WordPress functions.
But that would only be if you have to access WordPress externally. Normally your code would either go into your theme’s functions.php
file, or you would add your code to a custom plugin.
Related Posts:
- Dropdown with category selection
- Saving two categories from two dropdowns in front end posting form
- Get id of category from drop down menu
- How to add HTML5 ‘required’ attribute to wp_dropdown_categories() without JavaScripts?
- How to retain the values from dropdown category lists after wrong form submission?
- How Do I Merge Categories With phpMyAdmin
- Help with multiple dropdown tags search
- How to use wp_category_checklist()?
- wp_dropdown_categories and custom taxonomy + custom post type
- How to provide value for ‘selected’ on wp_dropdown_categories() for ‘multiple’ options
- Additional form options based on category selected not working
- wp_dropdown_categories() scripts working erratically on sidebar
- How to use an array of categories as a dropdown?
- How do I display only two categories Instead of displaying all categories
- Dropdown Categories used in form shows no results when all is selected
- Trying to get variables in hacked category dropdown
- wp_list_categories walker without links on categories that have subcategories (to make a nested dropdown menu)
- Filter posts by categories ajax is showing nothing
- WordPress Customizer: Dropdown with Category output
- Filter By Category Dropdown List With Custom Taxonomies
- A dropdown with checklist
- How Do I Delete WordPress Posts Older Than 400 Days, From A WordPress Category
- Wp Dropdown Category Not Show Current As Title
- wp_dropdown_categories initial value
- Exclude category from drop down list form
- Trying to get categories and sub-category listing
- Get_term_meta() always returns false
- Woocommerce Category Sort Dropdown
- How to add custom option to wp_dropdown_categories?
- custom browse by
- Categories dropdown with all values selected using wp_dropdown_categories
- add custom option to get_categories dropdown
- Taxonomy for custom post type not found
- Form Value of drop down category + Translation of ‘show option none’
- How To Find Out WordPress Category Table in MYSQL?
- Add custom field to Category
- Does the ‘cat’ argument in query_posts fetch posts from subcategories as well as the given ID?
- Get Default Post Category From Settings
- Are Categories, Tags and Custom Taxonomies any different in regards to SEO?
- Display list of Sub-Categories and the posts they contain, within one main Category
- Create subdomains for tags and categories
- Categories – create a new separate set right after the default?
- How to get this only in small letters (lowercase)? [closed]
- How to totally get rid of Category in my blog?
- Is there a function to cause empty categories not to show in menus?
- Category Specific Archive
- How to select product category while adding new product in woocommerce? [closed]
- How do I count how many top level categories there are?
- How to get the number of child categories a specific parent category has?
- Removing category base form links messes up the parent-child behavior
- display most popular tags of category?
- Exclude category from loop not working
- How to list only child categories?
- Want to hide some categories from the categories meta box in the post editor for the two specific user roles
- Cannot add / edit categories to a post anymore
- List archived posts by subcategory
- What’s the Simplest Way to Override/Rewrite the %category% Permalink Structure Tag?
- Show Different Custom Menu on Different Category Pages
- How to get the id from the custom category?
- Category being displayed without base parmalink
- wordpress sub-category ( lowercase letters + non-latin characters ) = 404
- Unwanted Duplicate Product Categories in WooCommerce
- WP didn’t redirect to canonical category URL
- WP admin broken. Not saving catgories or adding categories to menu
- Set colors depending on category
- get_terms function not returning anything
- Getting All Post From Specific category in wpdb
- Single.php Category Post Count
- Jigoshop – only displaying 10 products
- Is there a way to only show Custom Meta Data on single posts from certain catagories
- Show the amount of posts in a tag in a specific category has
- display a widget on specific category and its sub categories
- How to hide category
- How to remove the category from post slug
- How to display posts from specific category using get_option function?
- Assign a custom post to a custom taxonomy based on custom field value
- How can i show categories of custom post
- How to show only child categories using the_category();
- Exclude posts without category from loop
- remove url from categories
- how to style show_count in wp_list_categories()
- Why in the e-mail notification about a new post published, the category of the post is always: Uncategorized
- How to get immediate children of a ‘term’ parent id through ‘get_terms’?
- Identify a single category and output some code on an archive page
- in post content shortcode works, but hardcoded in same page template doesn’t?
- front end add category to new post
- How to delete WooCommerce categories in bulk that only have one product
- Print categories and most viewed articles
- Get category of a taxonomy for a queries object in a loop
- ACF Gallery with Media Categories – how do display categories and sort
- Add category links?
- show posts found in multiple categories via category_name query string?
- Add html word before category
- Display last postings of 5 categories on homepage
- Category that can hold only specific number of post
- How to add the sidebar in all category page
- Function to reference post meta in place of category Woocommerce
- hide_empty property not working when using get_terms
- Category Redirection Problem
- Hierarchical outline of posts