4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 22, 2014, 09:35:08 AM

Login with username, password and session length
Search:     Advanced search
Check the new Tutorial subforum with helpfull guides and tutorials for modifications and tweaks.
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Modifications / Modifikationen
| |-+  Mods & Plugins (Releases & Support) (Moderators: mawenzi, Rembrandt)
| | |-+  [Mod] Homepage and Category Meta Title and Description For Better SEO
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
This topic has not yet been rated!
Author Topic: [Mod] Homepage and Category Meta Title and Description For Better SEO  (Read 8283 times)
ashfaq
Full Member
***
Offline Offline

Posts: 128

Thank You
-Given: 1
-Receive: 0


View Profile
« on: August 11, 2012, 05:12:34 AM »

I have a 4images based free desktop wallpaper website: http://www.deskbeauty.net
Its 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 Offline

Posts: 4096

Thank You
-Given: 108
-Receive: 860

Vienna


View Profile WWW
« 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

Meine 4Images Modifikationen  Now over 100 Modification Online!    Meine 4images Demo Seite


Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
ashfaq
Full Member
***
Offline Offline

Posts: 128

Thank You
-Given: 1
-Receive: 0


View Profile
« 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 Offline

Posts: 4096

Thank You
-Given: 108
-Receive: 860

Vienna


View Profile WWW
« 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

Meine 4Images Modifikationen  Now over 100 Modification Online!    Meine 4images Demo Seite


Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
ashfaq
Full Member
***
Offline Offline

Posts: 128

Thank You
-Given: 1
-Receive: 0


View Profile
« 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 Offline

Posts: 4096

Thank You
-Given: 108
-Receive: 860

Vienna


View Profile WWW
« 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

Meine 4Images Modifikationen  Now over 100 Modification Online!    Meine 4images Demo Seite


Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
ashfaq
Full Member
***
Offline Offline

Posts: 128

Thank You
-Given: 1
-Receive: 0


View Profile
« 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 Offline

Posts: 462

Thank You
-Given: 37
-Receive: 11

on to the top!


View Profile
« 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 Offline

Posts: 4096

Thank You
-Given: 108
-Receive: 860

Vienna


View Profile WWW
« 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

Meine 4Images Modifikationen  Now over 100 Modification Online!    Meine 4images Demo Seite


Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
bergblume
Sr. Member
****
Offline Offline

Posts: 462

Thank You
-Given: 37
-Receive: 11

on to the top!


View Profile
« Reply #9 on: November 03, 2012, 05:32:43 PM »

wie immer vielen Dank für den klasse Support!
Logged
Starblade
Newbie
*
Offline Offline

Posts: 10

Thank You
-Given: 4
-Receive: 0


View Profile
« Reply #10 on: October 23, 2014, 12:01:40 PM »

Ist dieser Mod auch interessant für Version: 1.7.11 ?  Very Happy
Logged
Rembrandt
Moderator
4images Guru
*****
Offline Offline

Posts: 4096

Thank You
-Given: 108
-Receive: 860

Vienna


View Profile WWW
« Reply #11 on: October 23, 2014, 12:46:43 PM »

Hi!
Ist dieser Mod auch interessant für Version: 1.7.11 ?  Very Happy
Aber sicher doch.. :9

mfg Andi
Logged

Meine 4Images Modifikationen  Now over 100 Modification Online!    Meine 4images Demo Seite


Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.246 seconds with 21 queries.