Plugin Directory

Changeset 2384265


Ignore:
Timestamp:
09/18/2020 08:13:59 AM (6 years ago)
Author:
amirkacem
Message:

fix duplicate meta title and met description of voyant page

Location:
dial-voyants
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • dial-voyants/tags/1.8/core/DialApi.php

    r2363951 r2384265  
    4242        $voyants = $this->ListConsultants($opts);
    4343        foreach ($voyants as $voyant){
    44             if(strtoupper($voyant->nom) === strtoupper($voyant_name)){
     44            if($voyant->nom === $voyant_name){
    4545                    $actual_voyant = $voyant;
    4646                    break;
  • dial-voyants/tags/1.8/dial-voyants.php

    r2383752 r2384265  
    146146        if(is_plugin_active( 'wordpress-seo/wp-seo.php' ) || is_plugin_active( 'wordpress-seo-premium/wp-seo-premium.php' )){
    147147
    148             add_filter('wpseo_metadesc', function($description) use ($voyant_description){
    149 
    150                 $description = wp_trim_words(mb_convert_encoding($voyant_description, "UTF-8", "HTML-ENTITIES"),25,'...');
     148            add_filter('wpseo_metadesc', function($description) use ($voyant_description,$voyant_name){
     149                if($voyant_description){
     150                    $description = wp_trim_words(mb_convert_encoding($voyant_description, "UTF-8", "HTML-ENTITIES"),25,'...');
     151
     152                }else{
     153                    $description = " Cabinet ".get_bloginfo('name')." : Consultation de voyance par telephone avec".$voyant_name;
     154                }
    151155                return $description;
    152156            });
    153157
    154             add_filter('wpseo_title',   function ($title)  use ($voyant_name) {
    155                 return 'voyance par téléphone avec ' .$voyant_name." | ".get_bloginfo('name');
     158
     159            add_filter('wpseo_title',   function ()  use ($voyant_name) {
     160                if(get_query_var('lang')=='be'){
     161                    $title = "Voyance par téléphone depuis la Belgique avec     ".$voyant_name;
     162                }else if(get_query_var('lang')=='su'){
     163                    $title = "Voyance par téléphone  depuis la Suisse  avec ".$voyant_name;
     164
     165                }else{
     166                    $title = "Voyance par téléphone  avec ".$voyant_name;
     167                }
     168                return $title;
    156169
    157170            });
     
    159172
    160173        }else{
    161             add_filter( 'pre_get_document_title',   function ( $title ) use ($voyant_name) {
    162                 return 'voyance par téléphone avec '.$voyant_name;
     174            add_filter( 'pre_get_document_title',   function () use ($voyant_name) {
     175                if(get_query_var('lang')=='be'){
     176                    $title = "Voyance par téléphone depuis la Belgique avec     ".$voyant_name;
     177                }else if(get_query_var('lang')=='su'){
     178                    $title = "Voyance par téléphone  depuis la Suisse  avec ".$voyant_name;
     179
     180                }else{
     181                    $title = "Voyance par téléphone  avec ".$voyant_name;
     182                }
     183                return $title;
    163184            }, 10 );
    164185        }
  • dial-voyants/trunk/core/DialApi.php

    r2363951 r2384265  
    4242        $voyants = $this->ListConsultants($opts);
    4343        foreach ($voyants as $voyant){
    44             if(strtoupper($voyant->nom) === strtoupper($voyant_name)){
     44            if($voyant->nom === $voyant_name){
    4545                    $actual_voyant = $voyant;
    4646                    break;
  • dial-voyants/trunk/dial-voyants.php

    r2383752 r2384265  
    146146        if(is_plugin_active( 'wordpress-seo/wp-seo.php' ) || is_plugin_active( 'wordpress-seo-premium/wp-seo-premium.php' )){
    147147
    148             add_filter('wpseo_metadesc', function($description) use ($voyant_description){
    149 
    150                 $description = wp_trim_words(mb_convert_encoding($voyant_description, "UTF-8", "HTML-ENTITIES"),25,'...');
     148            add_filter('wpseo_metadesc', function($description) use ($voyant_description,$voyant_name){
     149                if($voyant_description){
     150                    $description = wp_trim_words(mb_convert_encoding($voyant_description, "UTF-8", "HTML-ENTITIES"),25,'...');
     151
     152                }else{
     153                    $description = " Cabinet ".get_bloginfo('name')." : Consultation de voyance par telephone avec".$voyant_name;
     154                }
    151155                return $description;
    152156            });
    153157
    154             add_filter('wpseo_title',   function ($title)  use ($voyant_name) {
    155                 return 'voyance par téléphone avec ' .$voyant_name." | ".get_bloginfo('name');
     158
     159            add_filter('wpseo_title',   function ()  use ($voyant_name) {
     160                if(get_query_var('lang')=='be'){
     161                    $title = "Voyance par téléphone depuis la Belgique avec     ".$voyant_name;
     162                }else if(get_query_var('lang')=='su'){
     163                    $title = "Voyance par téléphone  depuis la Suisse  avec ".$voyant_name;
     164
     165                }else{
     166                    $title = "Voyance par téléphone  avec ".$voyant_name;
     167                }
     168                return $title;
    156169
    157170            });
     
    159172
    160173        }else{
    161             add_filter( 'pre_get_document_title',   function ( $title ) use ($voyant_name) {
    162                 return 'voyance par téléphone avec '.$voyant_name;
     174            add_filter( 'pre_get_document_title',   function () use ($voyant_name) {
     175                if(get_query_var('lang')=='be'){
     176                    $title = "Voyance par téléphone depuis la Belgique avec     ".$voyant_name;
     177                }else if(get_query_var('lang')=='su'){
     178                    $title = "Voyance par téléphone  depuis la Suisse  avec ".$voyant_name;
     179
     180                }else{
     181                    $title = "Voyance par téléphone  avec ".$voyant_name;
     182                }
     183                return $title;
    163184            }, 10 );
    164185        }
Note: See TracChangeset for help on using the changeset viewer.