It depends on where you want to put the ‘hello’ thing. For instance, you could use the_content filter to put it before or after the content:
function wp_add_to_the_content($content) {
$content="Text before the content." . $content . 'Text after the content';
return $content
add_filter('the_content', 'wp_add_to_the_content',10,1);
You’d need to add any CSS and other tags to format thing.
There are also filters for other parts of the post- like the post title, etc.
Added
The OP added to the question indicating he wants the message to be displayed before the loop is processed.
The answer to this question will provide guidance: https://stackoverflow.com/questions/23741354/adding-content-before-the-loop ; use the loop_start
filter which ‘fires’ before the loop is started.
Related Posts:
- How to pass a numeric id to a page template?
- How to remove a parent theme template from Quick Edit?
- is_page_template returning false
- Limit page template choice by page title or ID?
- Using conditional statements in place of custom Page templates
- change the Theme dynamically
- Why do some pages on my site use the previous theme?
- Template tag for /page/# structure
- Custom page template not working on mobile
- How To Create A Paginated List Of All Categories On My Site?
- Password protected posts redirects
- Overriding page template using page_template filter
- Loading page content into a variable in template
- Capturing arbitrary semantic URL arguments
- How do I display the text inside the WP editor for a page with a custom template?
- Dynamically assign same page template to child page as parent
- What content should go in index.php?
- How can I dynamically load another page template to provide an alternate layout of the posts?
- get url page template
- Posts archive index pagination in a static page custom query
- How to Set a Custom Template for Blog Posts
- get page title, url and excerpt of a page
- How can I have a static title on my blog page?
- Use is_category(), is_tag(), … in functions.php
- How do I add a body class to specific pages?
- How to list all titles of posts on a specific page?
- Adding PHP/HTML code inside page from custom template
- How to handle a missing page.php?
- Customize edit.php Pages listing in dashboard to show only pages with a particular template applied?
- Programatically switch page template?
- Remove all theme CSS & JS from wp_head (but only for 1 page template)
- Conditionally load child themes
- remove page template from dropdown?
- Export csv and force download in template page
- WPML in custom page templates
- Why (and how?) is get_header() erasing all my stuff?
- get_pages — parent vs child_of?
- WordPress can’t find IXR_Client
- How to pass outside function to WP_REST_Request
- page.php not displaying content
- Use the_title_attribute() for the WHERE parameter in a page template
- Only show content if current page is NOT one of 2 page templates [closed]
- How to make text show up – new page template
- Adding general page content to page templates
- using the loop with a custom table
- Content pulled from page template instead of editor
- SuperCache for Custom Templates
- how to remove all body classes in wordpress
- WordPress 3.3.1 Page template not showing in admin area
- What is wrong with my page.php?
- wp-cli for Creating page-template
- Single page Template for pages that begin with ‘confirmation-‘
- What content to use for inserting images
- Want to exclude slider from page.php in header
- Can i forget about the post loop inside the page template?
- get_avatar() as backround image
- get_the_excerpt() inside WP_Query – link URL Incorrect
- How to make Dynamic Page Template based on Post ID’s
- Template Tag Does Not Work in Page Template
- Contact template doesnt appear in page template options
- Does get_template_part() content gets parsed if it’s not executed?
- Get_template_part seems to be ignoring my template
- Proper way to create custom static page
- How can I correctly redirect user to the submitted post and define a template for each new post in WordPress?
- How to display all child/sub pages from all parent pages?
- Find php file anywhere in folder and subfolder from template
- WordPress page template to show posts as per category dynamically
- page.php template file render a core gutenberg component programmatically
- Subpage is redirecting to spam site
- How to Change Site Elements based on referring URL
- How to integrate custom HTML template in a premium wordpress theme?
- How to load page template according to the Searched Page
- Set page template automatically according to parent slug
- How to display the contents of URL1 when user visits URL2
- How to require specific PHP files for specific templates
- Static page won’t identify template
- Restrict Access to Logged-In Users Page Template
- wp_enqueue_scripts doesn’t work for template pages
- What is the best way to manage pages content?
- Add additional templates to the templates drop down on add page menu [duplicate]
- Custom templates stopped working
- .htaccess help to a beginner
- Single page theme: Can I render other pages with their respective themes within another page?
- Special 404 header page
- How can I set full width page layout in a default post page?
- E-Commerce Products Page Sidebar Formatting
- How to move from page template to page template
- Lead Generation with Cookies in WordPress
- Recents posts pulling from different post type
- trying to add custom landing page to Twenty Eleven- can’t get rid of Twenty Eleven header/container? [duplicate]
- Fetching Image from other post/page with custom type
- wordpress header leaks into body in a specific template
- Display child page on parent
- Utilizing the template hierarchy while storing page templates in a subdirectory
- Show page name in browser
- How do I create a page template that doesn’t show URL, sidebar, nav menu, footer?
- Animation as shown in the link
- How to show feature image, Title, Breadcrumb before Page in flatsome theme
- WordPress Page Slug with URL custom template
- Can wordpress search inside a custom page template?