You can determine whether the blog is displayed using is_home()
:
<?php
if ( is_home() ) {
echo 'Blog';
}
else {
the_title();
}
?>
Be aware that the the_title()
function only displays the title of the current post. If you’re on any other kind of page, such as the blog, a category archive, a date archive, or search results; the post title is probably not what you want to display in that context. You will want to use some of the many available conditional tags to determine what you’re currently viewing, so that you can determine what title to display.
If you look at the template hierarchy you can get an idea of what kinds of pages WordPress will query. The conditional tags will help you find out where in that hierarchy you are.
Related Posts:
- Using php to overwrite or replace title tag, while using yoast [closed]
- Problem in wordpress with “-“
- add_theme_support( ‘title-tag’ ) in conflict with custom titles function
- Modify page title format (when using title-tag)
- Empty title on front page/Home
- REQUIRED: The theme must not used the tags. | REQUIRED: The theme must not call to wp_title()
- How to get page’s ID if I know the title only?
- How to make a H1 different then the Title?
- How do I edit the tag without using the deprecated `wp_title()` function?
- Change Default Custom Fields Metabox Name
- Display post title on individual image attachment page
- Include category title in wp_title
- Automatically add title attribute to links in WordPress
- How can i remove JUST the title tag from wp_head() function?
- Custom Post Type Title Placeholder [duplicate]
- Site title not showing. What can I do?
- Remove site name from tag
- Change title tag dynamically or within plugin?
- Get title of page from URL
- Remove site name from title post
- Change all Post titles into [Title Case] format
- How to modify a title tag in genesis?
- How do I set the blog name?
- How to Change Title Attribute to be different from Page title
- How to sanitize post title with commas
- How to echo a different title to the page if it’s opened on an android mobile phone
- Adding schema.org itemprop to WP4.1 Title Tag
- How to edit title on Edit post pages?
- How do I shorten the title lenghs with Elementor theme? [closed]
- How to Customize “WordPress > Error” Text in Titlebar?
- Changing title & add Breadcrumbs
- Sanitize the output of the_title() or the_title_attribute() to remove whitespace
- Change page title dynamically before header is rendered
- Where does Yoast SEO plugin sets the site/page title?
- For better digital journalism, how to store a second title and excerpt?
- After I set the title, it over-wrote all the titles for the individual pages
- Wrap the_title_attribute in a H2 within a Conditional Tag?
- Title tags show twice
- Setting page title and keywords from PHP code
- Anyway to specify what should appear in in .php file?
- How to solve the site tag being displayed twice?
- How can I override the post title when a post is set to sticky? [closed]
- disallow publish posts with special title
- Print post title with markup
- How to get current page title inside a page’s template
- Homepage meta title and description not showing in search engines?
- How to remove Title and CSS styling of title from particular page
- Double bar “|” in title (By WP SEO Yoast?) [closed]
- Delete a repeated part of post title in WordPress
- how to set alt & title for featured image get_the_post_thumbnail
- How to add publish date in the title
- How come I get internal server error even with try catch for get_the_title in functions.php?
- Print title page in header of a specific page
- How to give titles to custom post type as “unique” incremental number?
- Front page displays different than all other pages?
- How to disable publish button if post title exists
- Wp Admin Bar Customizing Labels
- Change auto post title generation according to different post properties
- Need help with page title (Static front page)
- Array to modify post titles
- How do I remove ‘Home’ from homepage title?
- How to set “lang” attribute for post/page title?
- Inconsistent title for posts
- Title don’t function as link
- Enclose title within a div?
- Title how does page no work in Twenty Eleven
- strtolower
- Getting the Image Title (not the post title)
- how to change the title of tag page?
- how to add dynamic text before and after of post title
- I want to add number after post tittle for each category
- Add text to the first “title”=>get_the_title($post->ID), and shorten
- Special characters in post_title replaced by ‘?’
- Title tag on home using front-page template not showing
- Limit title length
- Remove title bar from post-new.php
- How do you change the title of the Edit Post page?
- How to get page title () in a different order?
- How can I remove an unwanted character from the main page’s title?
- How do you keep the title of a post. to NOT show when publishing the post?
- Custom title when using shortcode
- Change font and Colours in Menus
- Blog Post Title apearing twice
- What change does this code need to include title of parent?
- Setting Page Title Yoast
- How to modify title tag in a plugin?
- How to Implement Category.php page title in wordpress custom template?
- Why I can not modify the appereance of my title web site in google? [closed]
- Add Placeholder in WordPress Editor Content Box
- How to delete posts which have same title?
- Generate page title tag from the content of H1
- Append text after wordpress title
- What is the wordpress page title php code?
- How to add … after a particular word/character limit to the title
- Remove post title in catogory page
- Change Bookmark Name without Changing TITLE Tag [closed]
- reformat entry-title with two different styles
- Trying to get more space removed from my header
- How to edit specific title instead of all the title calls
- How to change a wordpress website title in google SERP [closed]