- Statut : non résolu
- Ce sujet contient 2 réponses, 2 participants et a été mis à jour pour la dernière fois par sylvainbr, le il y a 11 années et 8 mois.
-
AuteurMessages
-
16 avril 2013 à 17 h 38 min #523150
Bonjour,
Ma configuration WP actuelle
– Version de WordPress : WP 3.3.2
– Version de PHP/MySQL : 5.3.3-7
– Thème utilisé : Host
– Extensions en place : Better Tag Cloud, Events Manager, Image Widget, Lightbox Plus, message ticker, Sidebar Login, Simple:Press, Subscribe To Comments, TinyMCE Advanced, WP-DBManager, WP-Memory-Usage, WP Complete Backup
– Nom de l’hebergeur : NT conseil
– Adresse du site : http://armeco.org/Problème(s) rencontré(s) :
Ayant parcouru le WEB toutes les réponses ne convienne pas à mon thème. Je ne veux pas changer de thème comme certaines personnes donnent comme solution.
Voici une copie de mon header.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta name="Author" content="themes wordpress - http://themeswordpress.fr" />
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?> » />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title><?php if (is_home () ) { bloginfo('name'); } elseif ( is_category() ) { single_cat_title(); echo ' - ' ; bloginfo('name'); }
elseif (is_single() ) { single_post_title(); }
elseif (is_page() ) { bloginfo('name'); echo ': '; single_post_title(); }
else { wp_title('',true); } ?></title>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/script.js"></script>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?> » type= »text/css » media= »screen » />
<!--[if IE 6]><link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.ie6.css" type="text/css" media="screen" /><![endif]-->
<link rel="alternate" type="application/rss+xml" title="<?php printf(__('%s RSS Feed', 'kubrick'), get_bloginfo('name')); ?> » href= »<?php bloginfo('rss2_url'); ?> » />
<link rel="alternate" type="application/atom+xml" title="<?php printf(__('%s Atom Feed', 'kubrick'), get_bloginfo('name')); ?> » href= »<?php bloginfo('atom_url'); ?> » />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?> » />
<?php wp_head(); ?>
</head>
<body>
<div class="PageBackgroundGradient"></div>
<div class="Main">
<div class="Sheet">
<div class="Sheet-tl"></div>
<div class="Sheet-tr"><div></div></div>
<div class="Sheet-bl"><div></div></div>
<div class="Sheet-br"><div></div></div>
<div class="Sheet-tc"><div></div></div>
<div class="Sheet-bc"><div></div></div>
<div class="Sheet-cl"><div></div></div>
<div class="Sheet-cr"><div></div></div>
<div class="Sheet-cc"></div>
<div class="Sheet-body">
<div class="Header">
<div class="Header-png"></div>
<div class="Header-jpeg"></div>
<div class="logo">
<h1 id="name-text" class="logo-name"><a href="<?php echo get_option('home'); ?>/ »><?php bloginfo('name'); ?></a></h1>
<div id="slogan-text" class="logo-text"><?php bloginfo('description'); ?>Certaines personne préconisent d’insérer le codes suivants dans le fichier function.php
$artThemeSettings = array(
‘menu.showSubmenus’ => false,
‘menu.homeCaption’ => « Home »,
‘menu.showHome’ => true,
‘menu.topItemBegin’ => « <span class="l"></span><span class="r"></span><span class="t">« ,
‘menu.topItemEnd’ => « </span> »
);le faite d’insérer le code suivant dans l’entête $artThemeSettings dans le fichier function.php, ne convient pas à mon site. Les pages du site sont toutes blanche sans message d’erreur.
$artThemeSettings = array(
‘menu.showSubmenus’ => « true »
‘menu.homeCaption’ => « Home »,
);voici une copie de mon fichier function.php
<?php
$artThemeSettings = array(
'menu.showSubmenus' => « true »
);
load_theme_textdomain(‘kubrick’);
if (!function_exists(‘get_previous_posts_link’)) {
function get_previous_posts_link($label)
{
ob_start();
previous_posts_link($label);
return ob_get_clean();
}
}
if (!function_exists(‘get_next_posts_link’)) {
function get_next_posts_link($label)
{
ob_start();
next_posts_link($label);
return ob_get_clean();
}
}
function art_comment($comment, $args, $depth)
{
$GLOBALS[‘comment’] = $comment; ?>
<li <?php comment_class(); ?> id= »li-comment-<?php comment_ID() ?>« >
<div id="comment-<?php comment_ID(); ?>« >
<div class="Post">
<div class="Post-tl"></div>
<div class="Post-tr"><div></div></div>
<div class="Post-bl"><div></div></div>
<div class="Post-br"><div></div></div>
<div class="Post-tc"><div></div></div>
<div class="Post-bc"><div></div></div>
<div class="Post-cl"><div></div></div>
<div class="Post-cr"><div></div></div>
<div class="Post-cc"></div>
<div class="Post-body">
<div class="Post-inner article">
<div class="PostContent">
<div class="comment-author vcard">
<?php echo get_avatar($comment,$size='48',$default='<path_to_url>‘ ); ?>
<?php printf(__('<cite class="fn">%s</cite> <span class="says">says:</span>‘), get_comment_author_link()) ?>
</div>
<?php if ($comment->comment_approved == ‘0’) : ?>
<em><?php _e('Your comment is awaiting moderation.') ?></em>
<br />
<?php endif; ?>
<div class="comment-meta commentmetadata"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?> »><?php printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time()) ?></a><?php edit_comment_link(__('(Edit)'),' ','') ?></div>
<?php comment_text() ?>
<div class="reply">
<?php comment_reply_link(array_merge( $args, array('depth' => $depth, ‘max_depth’ => $args[‘max_depth’]))) ?>
</div>
</div>
<div class="cleared"></div>
<?php if (is_page()) edit_post_link(__('Edit this entry.', 'kubrick'), '<p>‘, ‘</p>‘); ?>
</div>
</div>
</div>
</div>
<?php
}
if (function_exists('register_sidebars')) {
register_sidebars(1, array(
'before_widget' => ‘<!--- BEGIN Widget --->‘,
‘before_title’ => ‘<!--- BEGIN WidgetTitle --->‘,
‘after_title’ => ‘<!--- END WidgetTitle --->‘,
‘after_widget’ => ‘<!--- END Widget --->‘
));
}
function art_normalize_widget_style_tokens($content) {
$bw = ‘<!--- BEGIN Widget --->‘;
$bwt = ‘<!--- BEGIN WidgetTitle --->‘;
$ewt = ‘<!--- END WidgetTitle --->‘;
$bwc = ‘<!--- BEGIN WidgetContent --->‘;
$ewc = ‘<!--- END WidgetContent --->‘;
$ew = ‘<!--- END Widget --->‘;
$result = »;
$startBlock = 0;
$endBlock = 0;
while (true) {
$startBlock = strpos($content, $bw, $endBlock);
if (false === $startBlock) {
$result .= substr($content, $endBlock);
break;
}
$result .= substr($content, $endBlock, $startBlock – $endBlock);
$endBlock = strpos($content, $ew, $startBlock);
if (false === $endBlock) {
$result .= substr($content, $endBlock);
break;
}
$endBlock += strlen($ew);
$widgetContent = substr($content, $startBlock, $endBlock – $startBlock);
$beginTitlePos = strpos($widgetContent, $bwt);
$endTitlePos = strpos($widgetContent, $ewt);
if ((false == $beginTitlePos) xor (false == $endTitlePos)) {
$widgetContent = str_replace($bwt, », $widgetContent);
$widgetContent = str_replace($ewt, », $widgetContent);
} else {
$beginTitleText = $beginTitlePos + strlen($bwt);
$titleContent = substr($widgetContent, $beginTitleText, $endTitlePos – $beginTitleText);
if (‘ ‘ == $titleContent) {
$widgetContent = substr($widgetContent, 0, $beginTitlePos)
. substr($widgetContent, $endTitlePos + strlen($ewt));
}
}
if (false === strpos($widgetContent, $bwt)) {
$widgetContent = str_replace($bw, $bw . $bwc, $widgetContent);
} else {
$widgetContent = str_replace($ewt, $ewt . $bwc, $widgetContent);
}
$result .= str_replace($ew, $ewc . $ew, $widgetContent);
}
return $result;
}
function art_sidebar($index = 1)
{
if (!function_exists(‘dynamic_sidebar’)) return false;
ob_start();
$success = dynamic_sidebar($index);
$content = ob_get_clean();
if (!$success) return false;
$content = art_normalize_widget_style_tokens($content);
$replaces = array(
‘<!--- BEGIN Widget --->‘ => « <div class="Block">rn <div class="Block-tl"></div>rn <div class="Block-tr"><div></div></div>rn <div class="Block-bl"><div></div></div>rn <div class="Block-br"><div></div></div>rn <div class="Block-tc"><div></div></div>rn <div class="Block-bc"><div></div></div>rn <div class="Block-cl"><div></div></div>rn <div class="Block-cr"><div></div></div>rn <div class="Block-cc"></div>rn <div class="Block-body">rn »,
‘<!--- BEGIN WidgetTitle --->‘ => « <div class="BlockHeader">rn <div class="header-tag-icon">rn <div class="BlockHeader-text">« ,
‘<!--- END WidgetTitle --->‘ => « </div>rn </div>rn <div class="l"></div>rn <div class="r"><div></div></div>rn</div>rn »,
‘<!--- BEGIN WidgetContent --->‘ => « <div class="BlockContent">rn <div class="BlockContent-body">rn »,
‘<!--- END WidgetContent --->‘ => « rn </div>rn</div>rn »,
‘<!--- END Widget --->‘ => « rn </div>rn</div>rn »
);
$bwt = ‘<!--- BEGIN WidgetTitle --->‘;
$ewt = ‘<!--- END WidgetTitle --->‘;
if ( » == $replaces[$bwt] && » == $replaces[$ewt]) {
$startTitle = 0;
$endTitle = 0;
$result = »;
while (true) {
$startTitle = strpos($content, $bwt, $endTitle);
if (false == $startTitle) {
$result .= substr($content, $endTitle);
break;
}
$result .= substr($content, $endTitle, $startTitle – $endTitle);
$endTitle = strpos($content, $ewt, $startTitle);
if (false == $endTitle) {
$result .= substr($content, $startTitle);
break;
}
$endTitle += strlen($ewt);
}
$content = $result;
}
$content = str_replace(array_keys($replaces), array_values($replaces), $content);
echo $content;
return true;
}
function art_list_pages_filter($output)
{
$output = preg_replace(‘~<li([^>]*)><a([^>]*)>([^<]*)</a>~’,
‘<li$1><a$2><span><span>$3</span></span></a>‘,
$output);
$re = ‘~<li class="([^"]*)(?: current_page_(?:ancestor|item|parent))+([^"]*)"><a ~';
$output = preg_replace($re, '<li class="$1$2"><a class="active" ', $output, 1);
$output = preg_replace($re, '<li class="$1$2"><a ', $output);
return $output;
}
function art_header_page_list_filter($pages)
{
global $artThemeSettings;
$result = array();
if ($artThemeSettings['menu.showSubmenus']) {
foreach ($pages as $page)
$result[] = $page;
} else {
foreach ($pages as $page)
if (0 == $page->post_parent)
$result[] = $page;
}
if (‘page’ == get_option(‘show_on_front’)) {
$pageOnFront = get_option(‘page_on_front’);
$pageForPosts = get_option(‘page_for_posts’);
if ($pageOnFront) {
foreach ($result as $key => $page) {
if (0 == $page->post_parent && $pageOnFront == $page->ID) {
unset($result[$key]);
break;
}
}
}
if (!$pageOnFront && $pageForPosts) {
foreach ($result as $key => $page) {
if (0 == $page->post_parent && $pageForPosts == $page->ID) {
unset($result[$key]);
break;
}
}
}
}
return $result;
}
function art_menu_items()
{
$homeMenuItemCaption = <<<EOD
Home
EOD;
$showHomeMenuItem = true;
$isHomeSelected = null;
if ('page' == get_option('show_on_front')) {
$pageOnFront = get_option('page_on_front');
$pageForPosts = get_option('page_for_posts');
if ($pageOnFront) {
$page = & get_post($pageOnFront);
if (null != $page)
$homeMenuItemCaption = apply_filters('the_title', $page->post_title);
$isHomeSelected = is_page($page->ID);
} elseif (!$pageOnFront && $pageForPosts) {
$page = & get_post($pageForPosts);
if (null != $page)
$homeMenuItemCaption = apply_filters(‘the_title’, $page->post_title);
}
}
if (null === $isHomeSelected)
$isHomeSelected = is_home();
if (true === $showHomeMenuItem)
echo ‘<li><a' . ($isHomeSelected ? ' class="active"' : '') . ' href="' . get_option('home') . '"><span><span>‘
. $homeMenuItemCaption . ‘</span></span></a></li>‘;
add_action(‘get_pages’, ‘art_header_page_list_filter’);
add_action(‘wp_list_pages’, ‘art_list_pages_filter’);
wp_list_pages(‘title_li=’);
remove_action(‘wp_list_pages’, ‘art_list_pages_filter’);
remove_action(‘get_pages’, ‘art_header_page_list_filter’);
}
add_filter(‘comments_template’, ‘legacy_comments’);
function legacy_comments($file) {
if(!function_exists(‘wp_list_comments’)) : // WP 2.7-only check
$file = TEMPLATEPATH.’/legacy.comments.php’;
endif;
return $file;
}Merci
16 avril 2013 à 17 h 59 min #888722C’est un theme artisteer ?
Tu peux modifer
$homeMenuItemCaption = <<<EOD
Home
EOD;et le remplacer par
$homeMenuItemCaption = <<<EOD
Accueil
EOD;C’est au début de la fonction art_menu_items
16 avril 2013 à 18 h 08 min #888723Et bien un grand merci.
Pourtant je faisait une recherche avec le mot Home.
J’avais l’impression de tomber que sur des fonctions et pas du texte libre.Merci
-
AuteurMessages
- Vous devez être connecté pour répondre à ce sujet.