Customising theme_link to always add a relevant title tag for the SEO of your site

Customising theme_link to always add a relevant title tag for the SEO of your site

متى بيع اسهم البنك الاهلي When building this site I wanted the links to all have the site name in the title tag as the keywords in the site name are what I want to be indexed for by Google. To do this I have made a simple theme_link function override to append the site name to the title tag if it is not already present.  

http://urbanswimmingpools.com.au/?isehs=%D9%83%D8%B3%D8%A8-%D8%A7%D9%84%D9%85%D8%A7%D9%84-%D8%B9%D9%86-%D8%B7%D8%B1%D9%8A%D9%82-%D8%A7%D9%84%D9%82%D9%8A%D8%A7%D9%85-%D8%A8%D8%A7%D9%84%D8%A5%D8%B3%D8%AA%D8%B7%D9%84%D8%A7%D8%B9%D8%A7%D8%AA&240=c8

شراء الاسهم السعودية While I was doing this I also noticed that not all of my links had the title of the page they were linking to in the title tag and as I didn't want to trawl through all of my code to try to find where I had been lazy and not added these in manually I also added the functionality to this theme link function to get the title of the page we are linking to and insert this in to the title tag as well. 

يمكنك محاولة هنا

http://skylarkstudios.co.uk/?pomulyyko=%D8%AE%D9%8A%D8%A7%D8%B1-%D8%AB%D9%86%D8%A7%D8%A6%D9%8A-%D9%83%D9%86%D8%AF%D8%A7&de9=c5 The results are pretty good, all the links on this site are run through this function so you can see the results for your self, I am hoping this will help with the SEO!

تداول سوق الذهب

حاول هذا الموقع على شبكة الإنترنت Below is the PHP code to do this that you would have to add to your theme template.php in your Drupal 7 installation. 

الموقع الأصلي

اسم نطاقك /** * Overrides the theme_link function to add the page title and site name to * all links, even if not provided. * * @param array $variables * @return string */ function mytheme_link($variables) {   // Add the site name variable to the end of link titles for SEO static $site_name; if (empty($site_name)) { $site_name = variable_get('site_name'); }   $attributes = $variables['options']['attributes']; $text = trim(check_plain(strip_tags($variables['text']))); if (!empty($attributes['title'])) { if (mb_strpos($attributes['title'], $site_name) === FALSE) { $attributes['title'] .= " | " . $site_name; } } else { $normal_path = drupal_get_normal_path($variables['path']); $item = menu_get_item($normal_path); if (!empty($item['title'])) { $attributes['title'] = $item['title'] . " | " . $site_name; } elseif (!empty($text)) { $attributes['title'] = $text . " | " . $site_name; } else { $attributes['title'] = $site_name; } }   return '<a href="' . check_plain( url( $variables['path'], $variables['options'] ) ) . '"' . drupal_attributes($attributes) . '>' . ($variables['options']['html'] ? $variables['text'] : check_plain($variables['text']) ) . '</a>'; }

Comments

2

موقع الكتروني Hi John, If you ask me I am going to say Drupal as this is what I work with but there are also arguments for WordPress, Joomla and some others.

http://sejrup-it.dk/?centosar=%D9%83%D9%85-%D8%B3%D8%B9%D8%B1-%D8%A7%D9%84%D8%AC%D8%B1%D8%A7%D9%85-%D8%A7%D9%84%D8%B0%D9%87%D8%A8-%D8%A7%D9%84%D9%8A%D9%88%D9%85&8f6=08

انتقل إلى موقعي It just depends on what you want, what skills you have and your budget.

موقع تداول بورصة الذهب

Comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.