Cómo cambiar enlace en imagen en Wordpress

  • Autor Autor hellboytnt10
  • Fecha de inicio Fecha de inicio
H

hellboytnt10

Beta
¡Usuario con pocos negocios! ¡Utiliza siempre saldo de Forobeta!
Hola amigos! Os explico:
Un amigo y yo acabamos de montar una web: Enlace eliminado, hemos utilizado la plantilla Adventure Journal de wordpress. Pero tenemos un problema que no podemos solucionar, la imagen que se supone debe redireccionar a nuestro twitter nos redirecciona a la página principal y no sabemos cambiarlo. ¿Alguien puede ayudarnos? La página está en proceso de montaje pero si alguien quiere aportar alguna idea será bienvenida.
 
Evidentemente el codigo detras de la imagen debe ser editado (desde "Apariencia>>Editor"). Podes mostrarnos el codigo? quizás asi podamos ver el problema con mas claridad...
 
Evidentemente el codigo detras de la imagen debe ser editado (desde "Apariencia>>Editor"). Podes mostrarnos el codigo? quizás asi podamos ver el problema con mas claridad...

Correcto, eso sí, si el template no dispone de opciones, tendrás que editar el header.php y cambiarlo a mano

Un saludo!
 
Ahí teneis el código de header.php. Gracias por vuestra ayuda.

<?php
/**
* @package WordPress
* @subpackage Adventure_Journal
*/
$AJOpts = get_option('ctx-adventurejournal-options');
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<title><?php
/*Print the <title> tag based on what is being viewed.*/
global $page, $paged;
wp_title( '|', true, 'right' );
// Add the blog name.
bloginfo( 'name' );
// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
echo " | $site_description";
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
echo ' | ' . sprintf( __( 'Page %s', 'adventurejournal' ), max( $paged, $page ) );
?></title>
<meta name="author" content="Designed by Contexture International | http://www.contextureintl.com" />
<meta name="iconpath" id="iconpath" content="<?php echo get_bloginfo( 'template_directory', 'raw' ); ?>/images/bh" />
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php
/* We add some JavaScript to pages with the comment form
* to support sites with threaded comments (when in use).
*/
if ( is_singular() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );

/* Always have wp_head() just before the closing </head>
* tag of your theme, or you will break many plugins, which
* generally use this hook to add elements to <head> such
* as styles, scripts, and meta tags.
*/
wp_head();
?>
</head>
<body <?php body_class(); ?>>
<?php if($AJOpts['browser-helper']=='true'): ?>
<div id="browser-helper">
<div id="bh-bg">
<table id="bh-notice" cellspacing="0" cellpadding="0" border="0">
<tr>
<td id="bh-icon-td" rowspan="3">
<img id="bh-icon" src="http://s.wordpress.org/images/browsers/ie.png" alt="browser icon" width="87"/>
</td>
<td id="bh-copy">
<div id="bh-warning"><?php _e('You are using an insecure version of <span id="bh-browsername">your web browser</span>. Please update your browser!','adventurejournal') ?></div>
<div id="bh-explain"><?php _e('Using an outdated browser makes your computer unsafe. For a safer, faster, more enjoyable user experience, please update your browser today or try a newer browser.','adventurejournal') ?></div>
<div id="bh-links">
<a id="bh-update" href="#"><?php _e('Update Your Browser','adventurejournal') ?></a> | <a href="http://www.google.com/chrome/"><?php _e('Try Something New','adventurejournal') ?></a> | <a href="#" id="bh-hide"><?php _e('Hide This Warning','adventurejournal') ?></a>
</div>
</td>
</tr>
</table>
</div>
<div id="bh-shadow"></div>
</div>
<?php endif; ?>
<div <?php echo ctx_aj_get_relationships($post->ID,'siteframe'); ?>>
<div id="container">
<div id="container2">
<div class="nav-horz nav-main" id="menu">
<div class="nav-main-left">
<div class="nav-main-right">
<?php wp_nav_menu( array( 'theme_location' => 'primary-menu' ) ); ?>
</div>
</div>
<div class="nav-main-bottom"></div>
</div>
<div class="clear"></div>
<!-- end header -->
<div id="header"><div id="header2"><div id="header3"><div id="header4">
<?php ctx_aj_site_title() ;?>
<div id="banner">
<?php

//wp_die('||| '.(string)has_post_thumbnail( $post->ID ).' |||');

// Check if this is a post or page, if it has a thumbnail, and if it's a big one
if (is_singular()
&& has_post_thumbnail( $post->ID )
&& ( $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) )
&& $image[1] >= HEADER_IMAGE_WIDTH ) {
// Houston, we have a new header image!
echo get_the_post_thumbnail( $post->ID );
} else if ( get_header_image() ) {
?>
<img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
<?php } ?>

</div>
</div></div></div></div>
 
No tienes que editar el archivo header.php, lo que tienes que cambiar está en el archivo functions.php sobre el final del archivo, encontrarás una linea así:

<a href="<?php echo home_url( '/' ) ?>"><img src="<?php echo 'http://'.$_SERVER['SERVER_NAME'].'/'.$themeOpts['logo-path'];?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" /></a>

cambiar la linea: "<?php echo home_url( '/' ) ?>" por "tuperfiltwitter"
y la linea:"<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" por "Encontranos en Twitter" o lo que te parezca, (ese es el texto alt para la imágen)
No olvides que tiene que ir entre comillas ""

si quieres, para que los usuarios no se salgan de tu página, puedes agregar el atributo target="_blank" a la etiqueta <a></a>, con lo que quedaría algo así:


<a href="http://www.twitter.com/tuperfiltwitter" target="_blank"><img src="<?php echo 'http://'.$_SERVER['SERVER_NAME'].'/'.$themeOpts['logo-path'];?>" alt="Seguinos en Twitter" /></a>

Lo pruebas y avisas si te funcionó
 
Funcionó! Muchísimas gracias!!!
 
Atrás
Arriba