Solved

Yoast and Simple Press Titles

Posted on 2014-09-23
10
226 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
Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

 
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

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

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

Online promotion is consistently becoming more important for all types of businesses. From Facebook ads to search engines to YouTube videos, there are all sorts of channels that can effectively be used to promote a business or product. But how shoul…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

617 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