Solved

Yoast and Simple Press Titles

Posted on 2014-09-23
10
223 Views
Last Modified: 2014-09-23
All of the page titles on the forum section have the same title - the main title of the forum itself: http://www.sempdx.org/forum/search-specifics/

Using that page as the example, the title is SEMpdx Search Marketing Forum which is the same no matter what your viewing on the forum. What we need it to show for the title is the title you see in the light blue bar which is Search Specifics.

Neither Yoast or Simple Press have a solution for this. They feel that it's picking up the title correctly, which wordpress's wp_title, yes it is, but now we have over a hundred listed pages with that exact same title.

Anyone have any ideas on how to pick up that next title in the blue bar so we have unique page titles? I think even getting the deepest level in the url could be a decent solution as long as the dashes could be replaced with spaces and the first letter of each word capitalized.

Thanks for any help.
Heather
0
Comment
Question by:Dzynit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
10 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40339642
Agree with them, whatever plugin you are using for the forums is not setting the page title correctly.
0
 
LVL 14

Author Comment

by:Dzynit
ID: 40339673
Right. But I'm not going to pay for the support membership and continue arguing with the plugin author because the forum there at sempdx is no longer active for new posts. But the forum is staying in place so people can still read previous posts.

That's why I'm thinking the simplest solution would be to grab that last section from the urls and use them as the title. I just need help with some php that would grab that and then convert it into a visually correct title.
Like /search-specifics/ should convert into Search Specifics.

Do you agree something like that would work?
0
 
LVL 58

Expert Comment

by:Gary
ID: 40339689
Not knowing the plugin you could delve into the code, see what variable it is using for the title and use that in the page meta title tag.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Author Comment

by:Dzynit
ID: 40339711
I tried, but the plugin is so bulky. My customer doesn't want me to spend a pile of time on this either. Simplest solution is the best.
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40339831
You can try

$urlparts = explode("/",$_SERVER["REQUEST_URI"]);

$title=ucwords(str_replace("-"," ",$urlparts[count($urlparts)-1]));

Open in new window


And hardcode the $title in the meta tag.
0
 
LVL 1

Expert Comment

by:Richard Francis
ID: 40339860
It's not the most optimal solution but you could get the page title from the contents of div with the id spTopicHeaderName. You could then set the page title with jQuery.

Something like:

$(document).ready(function() {

  Var newTitle = $( "#spTopicHeaderName" ).text()
  $(document).prop('title', newTitle);

});

Open in new window

0
 
LVL 58

Expert Comment

by:Gary
ID: 40339865
Using javascript search engines et al will still list the original title
0
 
LVL 14

Author Comment

by:Dzynit
ID: 40339873
Thanks Richard, but I was thinking the same thing as Gary. Gary, I'm going to try your suggestion here shortly. I have something else to finish up then I get back to that site and try it out.
0
 
LVL 1

Expert Comment

by:Richard Francis
ID: 40339892
No worries. As I said it wasn't the most optimal solution.
0
 
LVL 14

Author Comment

by:Dzynit
ID: 40339955
Gary, I had to make one edit on the count to -2 because it was counting the trailing slash that's auto added and it works great.

Here's what I used:

to the theme's functions.php
function forumtitle() {
	$urlparts = explode("/",$_SERVER["REQUEST_URI"]);
	$title=ucwords(str_replace("-"," ",$urlparts[count($urlparts)-2]));
	if ($title == 'Forum') { $title = 'SEMpdx Search Marketing Forum'; }
	return $title;
}                                          

Open in new window


In the header.php (id of course being the forum's main page id #)
<title><?php if(get_the_id() == 392) { echo forumtitle(); } else { wp_title(); } ?></title>

Open in new window


Thank you very much!
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
SEO can be a real minefield to navigate, but there are three simple ways to up your SEO game just be re-assessing your content output.
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The viewer will learn how to dynamically set the form action using jQuery.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question