Place your file in the same directory as the template. On the single.php
and page.php
files you’ll want to include:
<?php include('your_file.php'); ?>
Related Posts:
- Include WP_Query in my own PHP file?
- Include a external PHP file into a WordPress Custom Template
- Include files in functions.php
- load/require specific php files for specific pages/templates/post types
- ob_get_clean returns empty string, ob_get_flush outputs string
- where to include a php file
- Include Class File in WordPress
- nowplaying.include.php Will Not Display Results
- integrating external php library into wordpress- the right way
- Change title and meta description in included page (not template)
- Can I change a variable in a content part while calling it?
- the_author() not working outside the loop
- How do I use the Simple HTML DOM Parser in plugin when other plugin already uses it?
- Put CSS inside a PHP file and include it the right way
- functions.php is being included twice, creating PHP fatal errors
- Custom theme: Alternatives to long list of ‘include’ in functions.php
- PHP help get_template_directory + PHP include
- code is skipping a div
- Why does abstracting html from plugin code result in loss of access to wordpress functions?
- PHP include is only working in certain places in my custom WP theme
- Correct and safe way to include php content in my page
- What is the proper way to include a PHP framework into my theme?
- php include not working in custom page
- Post’s ID pattern?
- Using WP functions such as the_title() in an included php file
- What’s the best way to include PHP code in pages?
- How to include custom PHP file both in header and footer files
- Include a file that has a function in it
- How do I call an external php non WordPress class into functions.php?
- require get_template_directory() . ‘path/to-my/file.php’ BREAKS customize > themes functionality
- Before & After Content – After Content directly below Before Content when using require_once
- loading a php file to a specific page id
- How do I fetch a data from an external database into my wordpress homepage
- How do I fetch a data from an external database into my wordpress homepage
- PHP get_category() function redeclared
- How do I / Is it possible to execute an external PHP file / function inside WordPress?
- Include a php file that is above WP installation hierarchically?
- How can I include a file related to blog URL? Nothing seems to work
- WordPress blog set up
- Shortcode not passing variable to included file
- php “use” not working in template [closed]
- Shortcode to include PHP file, pass various parameters to include?
- wordpress.org disallowing my plugin becuase of loading core files in cron cpanel file
- Should I use include(_once) or require(_once) for loading php-file with customizer settings?
- How to include checkbox in widget backend form?
- Upgrading PHP version results in “Use of undefined constant WP_CONTENT_DIR” warning?
- How to hide get_theme_mod if field empty
- renaming an admin menu item with decimal array index number
- How to get the original price of the product in woocommerce?
- How to make sure that only one wp_cron() runs at a time?
- Fatal error: Call to undefined function wpsc_cart_item_count()
- No wp-config.php file on local install of wordpress – site still displays
- Widgets not showing in my custom theme
- Edit category output
- Woocommerce Custom CSV export
- To echo or not to echo?
- How to limit the content coming from wordpress shortcodes?
- What is the fastest way to load PHP functions that are only used in one theme template?
- Writing scripts using WordPress / WooCommerce classes?
- Change description on specific WooCommerce product status change
- How do I attach a php file to an arbitrary slug and still have access to the wp-core functions?
- Woocommerce redirect thankyou page based on product ID doesn’t empty Cart
- Open post-content in archive page in a Modal box with bootstrap
- Creating own shortcode – echoeing php variable based on JS variable
- Sort meta-value in the sequence array in pre_get_post
- How do I link a button I created in theme customizer to a function?
- Filtering a Database Query
- anyway to put inside a $outprint=sprintf()
- Can’t save php string to a custom field
- What does $_GET[‘iphone’] do?
- Appended comments but they show up above the content instead of below
- get_template_directory adding FTP root folders in urls
- Is there any wordpress plugin to upload images and captions to multiple pages once
- Line breaks inside shortcode variable
- Site Health says I’m running an older version of PHP even after I upgraded to 7.4.4
- WordPress REST API register_rest_route give a 500 error
- woocommerce wc_create_order(); is creating multiple orders instead of one?
- Override Admin menu icon
- Trying to get property of non-object in WordPress Breadcrumbs
- How can i make a search box to search by custom field
- Error while loading wordpress site “Fatal error: Uncaught Error: Call to undefined function twentytwentyone_the_html_classes() in /home
- Database entry removed on browser refresh, Ajax PHP jQuery
- wp_Query with mutuplea values returns all posts
- How to stop hiding buttons forward / backward in pagination?
- Add to cart quantity dynamic
- Infinite looping next post link within a certain category on a post
- WordPress PHP version
- Woocommerce textarea format ignored
- Add Text Area To Child Theme’s Home Page
- Beginner Developing Theme with Bootstrap – NavMenu question
- remove blank space where sidebar was
- How to add thumbnails from recent posts to owl-carousel in wordpress automatically?
- Display 6 most recent post on homepage?
- Closed html class after counter = multiple of 3
- How can i call the facebook #hashtag images on my site
- URL prefix to include one PHP page
- Query category name by variable
- Shortcode for Visual Composer Grid fails turning string to integer
- Differences and dis/advanages between: Fast-CGI, CGI, Mod-PHP, SuPHP, PHP-FPM
- Custom plugin doesn’t show in admin menu – when code added, displays an empty page