Get the title into a variable, and use the variable in the included PHP instead:
$title = get_the_title();
include "yourfile.php";
yourfile.php:
<?php
echo $title;
?>
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?
- 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]
- How to include a php file in every post and page [duplicate]
- 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?
- Error Warning: Declaration of description_walker::start_el after PHP upgrade [duplicate]
- WordPress Warning: preg_replace(): JIT compilation failed: no more memory
- Append code into wp-config.php
- How to turn off redirection from ‘domain.com/login’ to ‘domain.com/wp-login.php’
- How to return multiples lines in a shortcode?
- wp_enqueue_style with style.php and WordPress functions
- fallback image for featured image
- Add attribute / custom attribute to product in woocommerce
- Access/update database with jQuery
- How to create another version of my site based on the same database
- How to get bool with `get_option()` when already registered setting with type `boolean`
- Displaying theme options in css
- Querying wpdb using PHP
- Reload part of checkout on changed shipping method
- Input data from email form not going to JSON file
- Should `wp_login` be used since it’s deprecated?
- admin-ajax Firing Error 400 When Logged In
- How to use a custom hook
- Hide HTML element (by class or ID) with PHP
- Verify if a category is the child of another category
- AJAX wp_insert_user WORKS but responds with “The site is not enabled”
- Redirection after submitting duplicate comment
- ACF Repeater Pagination stopped working since upgrade to php7.2
- Using featured image of blog archive page
- Highlight the links without using dropdown
- Automatically Add Page Links to Nav Menu
- add button to specific post
- Why, when moving a WordPress multisite network, have my theme customisations stopped working?
- Where should I copy a PHP file from wp-includes to, in order to override it in my child theme?
- How to edit wordpress pages through cpanel? [closed]
- How to get movies by date
- How to change the author box selection on a post to a custom taxonomy
- How to send a php var to jQuery Ajax call with two different file
- not outputting medium size image URL
- Download Featured Image Link in Post Shortcode
- Show subcategory name selected in specific category woocoommerce
- Posts Per Page with a button to add more Posts
- Add custom attribute to product’s HTML to woocommerce cart page
- Change WooCommerce template for PDF – access to custom field
- Detect what link user clicks and Redirect to a specific page for logged in users only
- Advanced WordPress SQL Query
- Editing existing pre-created menus in PHP
- Custom Meta Boxes and Fields Multicheck Issue
- Or operators in PHP [closed]
- how to iterate through xml data?
- Adding slides to an existing carousel manually
- Why can’t I include echo inside a variable? [closed]
- $post->ID calls for current page, but what is the code to call for any new page created and published in WordPress?
- How to increase excerpt length in wordpress? [duplicate]
- Are WordPress & PHP objectively and based on evidence going to die because the future is made of frontend rendering instead of server side rendering? [closed]
- Not able to see the error [closed]
- Login user into magento using wordpress account
- save array of objects with update_option
- What is the best way to reset the site? Different fails while set up
- Use of undefined constant issue
- Themeco Looper Provider Query String for current user posts [closed]