ashfaq
Full Member
 
Offline
Posts: 128
Thank You
-Given: 1
-Receive: 0
|
 |
« on: August 11, 2012, 05:12:34 AM » |
|
I have a 4images based free desktop wallpaper website: http://www.deskbeauty.netIts shows same one title on whole the website either it is homepage or any category and you know its not good for seo. As for better seo it is necessary that homepage has different meta title and description and every category has different meta title and description related to that category. So we can get better ranking in search engines. Will anyone please guide me how to do that.
|
|
|
|
|
|
Logged
|
|
|
|
Rembrandt
Moderator
4images Guru
   
Offline
Posts: 3752
Thank You
-Given: 85
-Receive: 734
Vienna
|
 |
« Reply #1 on: August 11, 2012, 12:29:42 PM » |
|
Hi! ....As for better seo it is necessary that homepage has different meta title and description and every category has different meta title and description related to that category. ..... you are right... 1.) search in your lang/main.php ,"?>" and insert above: 1 2 3 4 5
| //----------------------------------------------------- //--- META for Homepages ------------------------------ //----------------------------------------------------- $lang['meta_description'] = "Here come the Description for the Homepages"; $lang['meta_keywords'] = "Here,come,the,Keywords,for,the,Homepages";
|
2.) search in index.php: 1 2
| //----------------------------------------------------- //--- Show Categories ---------------------------------
|
insert above: 1 2 3 4 5 6 7
| //----------------------------------------------------- //--- SEO variables ----------------------------------- //----------------------------------------------------- $site_template->register_vars(array( "detail_meta_description" => $lang['meta_description'], "detail_meta_keywords" => $lang['meta_keywords'] ));
|
3.) search in categories.php: 1
| $site_template->register_vars(array('prepend_head_title' => $cat_cache[$cat_id]['cat_name'] . " - "));
|
and replace: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| $meta_description = !empty($cat_cache[$cat_id]['cat_description']) ? htmlspecialchars(strip_tags(trim($cat_cache[$cat_id]['cat_description']))) . ". " : ""; $meta_description = preg_replace('/[\n\t\r]+/', ' ',$meta_description); $meta_keywords = preg_replace("#[-_'`´\^\$\(\)<>\"\|,@\?%~\+\.\[\]{}:\/=!§\\\\]+#s", " ", $meta_description); $meta_keywords_array = array_unique(explode(" ",$meta_keywords)); $meta_keywords = ""; foreach($meta_keywords_array as $val){ $len = strlen($val); if ($len >= 5) { $meta_keywords .= $val.","; } }
$site_template->register_vars(array( "detail_meta_description" => $meta_description, "detail_meta_keywords" => $meta_keywords, "prepend_head_title" => $cat_cache[$cat_id]['cat_name'] . " - " ));
|
4.) search in your templates/header.html: 1
| <meta name="description" content="{detail_meta_description}{site_name}">
|
and replace: 1
| <meta name="description" content="{detail_meta_description}">
|
Now can you write in your lang/main.php the description and the keywords for your Home page. Do they have a category description, it displays as "META Description" on the current Category page. The "META Keywords" are generated automatically from the category description. mfg Andi
|
|
|
|
|
« Last Edit: August 11, 2012, 03:31:08 PM by Rembrandt »
|
Logged
|
|
|
|
ashfaq
Full Member
 
Offline
Posts: 128
Thank You
-Given: 1
-Receive: 0
|
 |
« Reply #2 on: August 11, 2012, 01:36:16 PM » |
|
Thanks bro for quick help but i found few errors, please have a look below. I am using 4images1.7.4 and cant find below code in categories.php 1
| $site_template->register_vars(array('prepend_head_title' => $cat_cache[$cat_id]['cat_name'] . " - ")); |
Also there is no file named header.php in templates folder, even header.html did not have your given below code. 1
| <meta name="description" content="{detail_meta_description}{site_name}"> |
As i can see this code will show unique title, description and keywords for homepage but how to show every category own unique title, description and keywords? Hope this time you will also hlep to do best seo which will be very usefull for all 4images users.
|
|
|
|
|
|
Logged
|
|
|
|
Rembrandt
Moderator
4images Guru
   
Offline
Posts: 3752
Thank You
-Given: 85
-Receive: 734
Vienna
|
 |
« Reply #3 on: August 11, 2012, 01:56:30 PM » |
|
.....Hope this time you will also hlep to do best seo which will be very usefull for all 4images users.
Sorry, but i make no Modification for 6 year old Galleries. i make her almost every mod, but i can't make one for each version. You can download the new 4images from here, and compare the code self. mfg Andi
|
|
|
|
|
|
Logged
|
|
|
|
ashfaq
Full Member
 
Offline
Posts: 128
Thank You
-Given: 1
-Receive: 0
|
 |
« Reply #4 on: August 11, 2012, 02:34:07 PM » |
|
Bro thanks for quick reply. I want to upgrade to new version but infact i made many modes in 4images 1.4.7 version and i really dont how many mods i made and how many can work with new version so its my bad luck that many times i think to upgrade to new version but these things bound me to stay on old version.
As you are coder, programer and moder so its not difficult task for you and it will take your few minutes but it will make my life very easy, please its a request. You can refuse my request but if you please do it i will be very thankfull.
|
|
|
|
|
|
Logged
|
|
|
|
Rembrandt
Moderator
4images Guru
   
Offline
Posts: 3752
Thank You
-Given: 85
-Receive: 734
Vienna
|
 |
« Reply #5 on: August 11, 2012, 03:24:26 PM » |
|
3.) search in categories.php( for V1.7.6 and older): 1 2
| //----------------------------------------------------- //--- Show Categories ---------------------------------
|
and insert above: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| $meta_description = !empty($cat_cache[$cat_id]['cat_description']) ? htmlspecialchars(strip_tags(trim($cat_cache[$cat_id]['cat_description']))) . ". " : ""; $meta_description = preg_replace('/[\n\t\r]+/', ' ',$meta_description); $meta_keywords = preg_replace("#[-_'`´\^\$\(\)<>\"\|,@\?%~\+\.\[\]{}:\/=!§\\\\]+#s", " ", $meta_description); $meta_keywords_array = array_unique(explode(" ",$meta_keywords)); $meta_keywords = ""; foreach($meta_keywords_array as $val){ $len = strlen($val); if ($len >= 5) { $meta_keywords .= $val.","; } }
$site_template->register_vars(array( "detail_meta_description" => $meta_description, "detail_meta_keywords" => $meta_keywords, "prepend_head_title" => $cat_cache[$cat_id]['cat_name'] . " - " ));
|
4.) search in your Template /header.html: 1
| <title>{site_name}</title>
|
and replace: 1 2 3
| <title>{prepend_head_title}{site_name}</title> <meta name="description" content="{detail_meta_description}"> <meta name="keywords" content="{detail_meta_keywords}">
|
mfg Andi
|
|
|
|
|
« Last Edit: August 14, 2012, 08:19:11 PM by Rembrandt »
|
Logged
|
|
|
|
ashfaq
Full Member
 
Offline
Posts: 128
Thank You
-Given: 1
-Receive: 0
|
 |
« Reply #6 on: August 12, 2012, 11:58:37 AM » |
|
Thanks man everything is working very well. Rembrandt you prove that you are really 4images guru. Thank you
Only one thing left untouched and its details page, will you pleaes also do some seo code for this page ?
|
|
|
|
|
|
Logged
|
|
|
|
bergblume
Sr. Member
  
Offline
Posts: 442
Thank You
-Given: 29
-Receive: 10
on to the top!
|
 |
« Reply #7 on: November 03, 2012, 10:11:05 AM » |
|
Servus Andi,
ich hätte zu diesem tollen MOD von dir eine kleine (Ergänzungsfrage):
wie kann ich bei der Meta Description die Zeichenanzahl definieren und bei den Meta Keywords die Anzahl der Keywörter? (vor allem dann auch für die details.php)
Danke dir für deinen Support hierzu!
Gruss, bergblume
|
|
|
|
|
|
Logged
|
|
|
|
Rembrandt
Moderator
4images Guru
   
Offline
Posts: 3752
Thank You
-Given: 85
-Receive: 734
Vienna
|
 |
« Reply #8 on: November 03, 2012, 11:58:20 AM » |
|
Hi! suche in Step 3.): 1 2 3
| $site_template->register_vars(array( "detail_meta_description" => $meta_description,
|
und füge darüber ein: 1 2 3
| $meta_description = word_count($meta_description,10); // <- die Anzahl der Wörter kannst du hier festlegen. $meta_keywords = word_count($meta_keywords,10); // <- die Anzahl der Wörter kannst du hier festlegen.
|
Ich würde bei dem Zählen der "Wörter" bleiben, bei "Zeichen" zählt alles auch leerzeichen, und dann hast du im Quelltext abgeschnitte Wörter drinnen stehen.
|
|
|
|
|
|
Logged
|
|
|
|
bergblume
Sr. Member
  
Offline
Posts: 442
Thank You
-Given: 29
-Receive: 10
on to the top!
|
 |
« Reply #9 on: November 03, 2012, 05:32:43 PM » |
|
wie immer vielen Dank für den klasse Support!
|
|
|
|
|
|
Logged
|
|
|
|
|