If you only need the title you can request it outside the loop easily.
Try and call the_title() in your header. It should work
But you have to be aware that if you don’t put a condition, each page of your website will display its title in the header section.
EDIT: the function to call is get_the_title($post->ID) since the_title() doesn’t allow you to specify the post id as an argument. You can check on the WordPress Codex for function allowing you to query information from your post outside the loop.
Related Posts:
- How to get year, month and hour in WordPress?
- Is sanitize_title_with_dashes formatting function too liberal (in terms of accepted characters)?
- How to set up VS Code for WP plugin/theme development in 2021? [closed]
- trigger html cleanup for all posts
- Customize position of social icons in upme plugin [closed]
- Function sanitize_title() does not appear to be working
- Calling PHP Titles inside Javascript Markup
- Changing Date Format on Custom Meta Data w/shortcode call
- Reformat data within a nested array
- ACF loop and php formatting
- Generating a number based on post ID
- Adding first / last CSS classes to menus
- Hide custom image sizes from media library
- How to paginate a list of custom taxonomy terms?
- Conditionally loading JavaScript based on the Advanced Custom Fields in the post
- reason of splitting theme files to multiple files
- Limit the Excerpt field in WP-Admin in words
- Problem with Woocommerce REST API Authentication
- How to get custom image size for image uploaded in Customizer
- How to change / delete product short description in Woocommerce
- How do I add HTML to a PHP function [closed]
- register_activation_hook isn’t adding table to DB
- how to get the value of time left for a transient
- Remove query string specific key value
- is_page “range” for if statement?
- How to Fetch values from WP database based on selected option value by onchange using PHP?
- How to create a custom category of wordpress admin
- WordPress child theme fails to override parent navigation menu in /inc/structure/header.php
- Customizer: Output default value in Customizer CSS
- WordPress Ignoring .user.ini
- Cron events are disappearing, or cannot be updated in WordPress
- Prev/Next child navigation for current page modifications?
- Adding rel tag to all external links
- Show success or error messages in Ajax response to WordPress custom registration form
- How to add a Custom Mailchimp AJAX Newsletter Subscribe Form
- How to store options in an array
- Generate sidebar depending on height of post
- Get author and excerpt from URL
- Sidebar not appearing in footer, but it appears everywhere else!
- How to create table in wordpress without plugin? [closed]
- Why is my str_replace not working on short code submitted by front-end?
- Skip foreach loop
- How do you create two separate Register pages?
- $_GET[‘updated’] does not work in WordPress 3.1?
- Include only posts with meta key “add_in_rss” in RSS Feed
- SOAP Request/Parsing XML From wp_send_json_success
- List post by title length
- get db values for external js file
- How to exclude a widget from W3 Total Cache Plugin
- Can we stop session reset if page reloads?
- Display WordPress Post on A Different Site
- WordPress the_content Page Load
- Add row to custom database Table and delete all rows older than 1 day
- How to split AJAX response into two divs
- Deleting expired session tokens in WordPress
- How to set variables with AJAX request to use in another function in WordPress
- How to hide the file name of 404.php in URL?
- when hooking to pre_user_query my wordpress crashes when using very simple commands?
- Hide publish date when update date
- I am having errors with checkout on wordpress
- Display articles with a different template in the home page | Solved |
- How to use Multi SQL Database in WordPress?
- Category Page Displaying all Pages
- Help me understand how Search function works using dynamic_sidebar()
- Looping through dummy posts and showing them in the main index.php
- How to display post meta bellow every posts
- Sudden Upload HTTP errors, PHP uploads and memory limits are already to high to my taste. Anything else?
- form submission reverts to index.php template
- Hide a specific category title from displaying on site
- How to change the structure/order of sections in a WordPress theme? [closed]
- WordPress mysql deos not work with php7
- i want add conditional for add category in wordpress
- Return to the beginning of the results of a for loop
- Need help with AJAX login to call php in functions.php to handle redirects based on user cap (role)
- Thumbnail wouldn’t scale to size properly
- Scheduling a post using publish date from a custom field. Resulting post is set as published in the future instead of scheduled
- PHP script to redirect traffic based on website accessed
- How to remove title tag with this filter
- Real time notification on user profile after new comment
- ACF Images If/else
- How to get the first letter from custom field?
- Meta box not saving spaces
- problem multisite with blog id
- A Space being added to url generated by custom plugin
- Attachments doesn’t update
- Why this plugin is not working?
- wp_customize_image_control default value
- get_post_meta is always empty when I use wp_mail
- check if .min.css stylesheet exists
- How do I use CSS or PHP to customize WordPress Form Manager Plugin Table?
- How to execute add_action() function from custom plugin to Crontrol plugin or do_action()?
- Incomplete term slugs output from a foreach loop with get_the_terms
- Custom Shortcode with Dynamic Button
- problem with php function error
- How can I change the URL via add_rewrite_rule()
- Variable ++ in query loop
- Generate and upload screenshot as featured image for user-submitted post
- How can precision be improved for the debug log timestamp?
- Redirect to current URL and append specified URL parameter on unsuccessful login through Elementor login form widget
- Custom WordPress Customizer Control for Typography Presets renders blank section or fallback , despite correct class registration