My wordpress homepage is not showing proper title - wordpress

In my wordpress site I set my homepage to be my latest posts and when it gets loaded title doesn't show like "Home - SiteName" but only " - SiteName".
How to fix this. I want to add Static "Home" in front or after "- SiteName"
Note:
1. I tried to check my home.php file but it is not there.
2. When I am saying "title" I mean the name or description shows in browser's tab.
Thanks

hi you can add this plugin and customize the TITLE as your requirement
https://wordpress.org/plugins/custom-title/screenshots/
thanks

You can add code like this to your header.php
<title><?php
if (is_front_page()) {echo ' My wonderful Page title in here ';}
else {echo wp_title('');}
?>
</title>
It will put the echo text as your homepage title, and the post/page title as the title for the other pages. Other WordPress code can be added into the php if you want something more comprehensive

Related

How to remove page name from google tab bar in wordpress

i want to remove the "home" or "shop" title from the google tab of my WordPress website as show in the picture.
how can i remove that "home" or any other page name from there in WordPress and just display my site name or maybe site title
You can do it by hooks, put this on function.php
add_filter('wp_title','hairmone_title',10,1);
function hairmone_title($title){
$title='Your new title'; //define your title here
return $title;
}
Easier is using Yoast Plugin
For all pages,
For single pages,
You should provide code here then we can help accurately.
But anyway, In header.php there is some code like <title><?php //Some Code Here ?></title>. You can remove everything between <title></title> and write your own text there.
For example <title> This is my website </title>

WordPress - Pull In HomePage Title To Any Other Page For Breadcrumb

I have set up a breadcrumb on my site and now due to wanting to integrate WPML into the site, I can no longer leave the homepage breadcrumb with a hard coded name.
Could anyone tell me how I can pull in the title from the front / static page (home page)?
I have the code below:
echo '<li>Home > </li>';
but am not able to find anything in the documentation that explains how to do this.
Thanks for your time and help.
Do you mean home page or front page? Either way, it will be a variation of get_options.
Check the codex.
Get the Front Page ID: https://codex.wordpress.org/Function_Reference/get_option#Parameters
Get a page title by ID: https://codex.wordpress.org/Function_Reference/get_the_title
Front Page
echo '<li>Home'.get_the_title(get_option('page_on_front')).'</li>';
Blog Page
echo '<li>Home'.get_the_title(get_option('page_for_posts')).'</li>';

How to show page title in blog post of wordpress site

I want to show the page title in single post page of wordpress theme. I tried to use <?php echo get_the_title() ?> but it return the post title, not the page title.
basically I want to show MY page title, in this case "Blog" below my header area in single.php file. how do I make it?
In order to get page title you need to use WordPress API function use the code below
<?php
$post_7 = get_post($id);
$title = $post_7->post_title;
?>
In wordpress both posts and pages have ids. So same function will work to get title of either post or page.
You have to pass this parameter to get the title of the page.
For reference see this link
http://codex.wordpress.org/Function_Reference/get_post

add page title to latest posts frontpage in wordpress

I set my reading section to latest posts in Wordpress. My homepage logs fine but I would like to add a page title above the posts. I have looked in my theme's files and couldn't find the file to edit. As a test, I tried to add an image to my theme's loop.php and it appeared above the post on my homepage. The location was right but the image appeared on every one of my category blog list pages. How do I add a page title to the homepage that only appears on the homepage above the blog list?
Here are some resources for you to use, WordPress: https://codex.wordpress.org/Function_Reference/get_the_title
Eg:
you can use
<?php echo get_the_title(); ?>
or
<?php echo get_the_title($ID); ?>
There is lot of resources on WordPress, best of luck!

WordPress home page title

My homepage's title is being displayed as the title of the last blog post created.
The code is:
<title><?php bloginfo('name'); ?></title>
So from my understanding that should display the blog title (set in general settings) on the homepage.
But its not. Its displaying the most recent post title.
What do i need to look for?
wp_title() is used to display the title of the page being displayed, but it uses the query results to get its value. So if you are executing a loop on many posts (which you obviously are on your homepage) and you don't reset it, you will get the title of the last post in your loop... logical.
Besides, note that the homepage is index.php in your theme, it is not a real page in WordPress. So it hasn't got a title. So wp_title() can't be of any use for you here.
Basically, your homepage has not got any title. So if this template is both for your homepage and other pages, you need to do a conditional check :
Is this homepage? (use is_home())
A. Yes, echo "Welcome on my great website"
B. No, wp_title(), which will echo the title of the page you are on...
Do you get it?
First off, you're executing two functions here -- wp_title, which retrieves the title of the page the visitor is currently on, and thereafter bloginfo, which with the argument 'name' indeed fetches your blog's name as set in the configuration.
However, there's a slight error in your code; you'd get the desired result as follows:
<title>
<?php
wp_title('|', true, 'right');
bloginfo('name');
?>
</title>
You should read about the parameters for wp_title on the WP Codex; the | gives you a delimiter, for example, and 'right' tells the function where to output said separator.
Note: I'd advise you to display both the post title and blog name, as only the blog name on every single page is both unhelpful for visitors and yields por results in search engine results.
I found your problem! Error in your code : remove > after <?php (you have written <?php>) so this :
<?php> bloginfo('name'); ?>
should now become this :
<?php bloginfo('name'); ?>
And it will work !

Resources