Hi,
On my site joshuamcghie.com I have set the front page to be an Album called 'Portfolio'. Problem is, the title tag for the album is used as the site title.
How can I have the front page display the album but have a different title tag to that when the actual album is linked to?
For example, I want 'Joshua McGhie - Photographer' as the title tag for the homepage which displays the album, but 'Portfolio' when the album is displayed in its native url (not the homepage url).
Hope this makes sense
Comments
Have you tried any SEO plugins for such title control?
We can try to produce code for that but link could be useful to get best understanding.
With regards.
I have tried SEO plugins but no change. The problem is, when you set the homepage to be a 'static page' using wordpress and then set an album to display from that page, the title tag will always match the title of the album. It sort of pulls the entire title through.
I set the title tag for the album using an SEO plugin and that works great. So when I go to the direct url for that album it displays its title that I set. Good.
But when I set the album to display as the homepage, it also uses the title of the album. I want it to use the title of the static front page or the title of the site in only this instance when displaying the root domain page for the site.
Hope this makes sense.
Probably need a single line of code for front page.php which allows me to set the title for the root page of the url only, and then obey the normal wordpress and SEO plugin rules for everything else.
Url is http://www.joshuamcghie.com for homepage
Direct album link is http://www.joshuamcghie.com/album/portfolio/
Thanks so much for looking into this. Your support is amazing.
I have my site set to show a static page on the homepage. I set this on the Settings->Reading->FrontPage. The title of this page is 'Welcome'. I have used Yoast SEO to present the title of this page as 'Joshua McGhie | Photographer'.
I have created an Album titled 'Portfolio'. I have used Yoast SEO to present the title as 'Joshua McGhie - Portfolio'.
I have set the front page to present the 'Portfolio' album by going to Hypershot->MainSettings->FrontPage and selecting 'Selected Album' and 'Portfolio' as the selection.
When I visit www.joshuamcghie.com the title is 'Joshua McGhie | Portfolio'. When I visit www.joshuamcghie.com/portfolio the title is 'Joshua McGhie | Portfolio'.
I want the homepage to reflect the title tag set for the 'Welcome' page, which would make the most sense. But it is using the title tag for the album name.
I think there just needs to be a bit of code so the theme will use the title of the page set to be the front page when using an album. Perhaps a snippet in the frontpage.php?
Your help on this is much appreciated, and if the change could be rolled into the next version of the theme also that would be great!
Thanks so much.
Anyway changes are not so easy, and I don't know about adding this to Theme, as not everybody uses SEO plugins. However you can make this changes in child theme to not lose them. Also I will mark this topic for myself and think about it.
First lets roll to
header.php
, so you can clean up if you like(NO NEED TO DO THIS STEP), and change code to Now our two main changes:front-page.php
line ~50 to Nextheader.php
to With regards.Would you be able to walk me through how to make these changes to the child theme? I haven't used child themes before. I have a basic understanding of their purpose, but not sure how to actually implement these changes in that way.
Regards
I made the changes you specified and there is no change in behavior. The album title tag is still being used as the homepage title tag when the album is set to display on the homepage.
A little more help?
The homepage title becomes 'www.joshuamcghie.com' and the portfolio title becomes 'Portfolio | ' but this is not right either.
So something has changed when SEO plugin is off (but incorrectly) and when SEO plugin is on, nothing happens differently.
Hope this feedback helps to pinpoint the issue.
I have tested this changes with Yoast SEO plugin, so no need for hard coding anything. After this changes it will use title set for front page.
Try doing this changes in normal theme again. If you will succeed then I will guide how to make this changes in child theme if it will be needed.
If you have some cache plugin then disable it to be sure that there are any effects visible.
With regards.
I have re-made the changes and double checked everything 5 times, but there is still no change
Perhaps you could take a quick look at my site for me, as I am totally stuck as to why your suggested changes are not working.
I will PM you login details now.
Thank you!
I have spend some time on your site, and I can't find differences in my and your installation and configuration of SEO plugin BUT on your site it is hijacking title tag(remove form HTML, and inserts it again) while on my it is left as it was.
That is the reason why it shows wrong title.
Maybe you did some changes somewhere in source or in plugin that could be effecting in this way?
With regards.
I haven't made any other source code changes. Could one of the other plugins I have running be causing the issue? I will start disabling them to see if I can find the problem.
In the mean time, would you be able to provide me with a hard-coded title solution for the home page? I will not be changing the title of the homepage again, so is not an inconvenience to hard code it if it will just work. Is a bit of a hack, but I don't mind
Thanks
The only code I have changed is the code you have asked me to.
Any other ideas?
Unfortunately cause SEO plugin is hijacking
<title>
tag, there is no way that any hardcoded solution will work, as this what I gave you was almost hardcoded.I am just changing flat so I will have NO extra time to search why in your case it is working this way. Only thing we can do is hard coding solution but without using this SEO plugin.
With regards.
For anyone else having this issue, try putting the code at the following link at the top of your functions.php:
http://pastebin.com/5cCmhLiQ
Make sure you edit the relevant bits in the code to suit your site's title, description and keywords.
Hope this helps someone - is working perfectly for me
Sorry that I wasn't helpful enough.
With regards.