¿Cómo agregar automáticamente <h1></h1> al título de entrada?

  • Autor Autor LuisNara
  • Fecha de inicio Fecha de inicio
LuisNara

LuisNara

Kappa
SEO
Verificación en dos pasos activada
Hola, tengo una pregunta, como puedo hacer para agregar el <h1></h1> automaticamente en el titulo de la entrada??

Estuve leyendo este tema

http://forobeta.com/wordpress/173199-agregar-h1-wordpress.html

Y vi que es así

Insertar CODE, HTML o PHP:
<h1><?php the_title(); ?></h1>

Pero en mi theme no se donde se pone, tiene algo así en el header.php

Insertar CODE, HTML o PHP:
<a  title="<?php the_title(); ?>" href="<?php the_permalink() ?>"><img class="panel" src="<?php getImage('1'); ?>" alt="<?php the_title(); ?>" width="130" height="200" />

Como lo debo agregar??

Saludos :encouragement:
 
[MENTION=35357]LuisNara[/MENTION] Eso va en el single.php :encouragement:

Ese código que pones arriba es el del logo xD

Si no lo ubicas pega el código del single PHP aquí y te ayudo
 
Emmmm eso no viene hecho para que al publicar automaticamente te de H1 en el titulo? asi tenia entendido yo 🙂 al menos alguien un dia me discutio aqui que en vez de liarme con un script use WP porque trae todo eso :ambivalence:
 
Seguro que ese código está en el header.php? más bien debería estar en el index.php

Simplemente agrega la etiqueta h1 al inicio de la línea.

PHP:
<h1><a  title="<?php the_title(); ?>" href="<?php the_permalink() ?>"><img class="panel" src="<?php getImage('1'); ?>" alt="<?php the_title(); ?>" width="130" height="200" /></h1>

Y en el style.css le agregas el estilo a los títulos, o lo puedes dejar como se ve actualmente.
 
Última edición:
[MENTION=35357]LuisNara[/MENTION] Eso va en el single.php :encouragement:

Ese código que pones arriba es el del logo xD

Si no lo ubicas pega el código del single PHP aquí y te ayudo

Pues esto es lo que tengo en en single:

Insertar CODE, HTML o PHP:
<?php get_header(); ?>
<div id="marco-post">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<h2 class="titulo"><a href="<?php the_permalink() ?>"  title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<div class="post">
<div id="mmedia">
<div class="sipno">
<?php the_content(); ?>
</div>
</div>
<div class="linea"></div>
</div>
<div class="generos">
<?php the_tags('Generos: ',' , '); ?> <?php edit_post_link('Editar', '<p style="font-weight: 700;text-align: right;display: block;float: right;">', '</p>'); ?>
</div>
<div id="relacion">
<?php
$original_post = $post;
$tags = wp_get_post_tags($post->ID);
if ($tags) {
  echo '<div class="trela">Peliculas relacionadas</div>';
  $first_tag = $tags[0]->term_id;
  $args=array(
    'tag__in' => array($first_tag),
    'post__not_in' => array($post->ID),
    'showposts'=>4,
    'caller_get_posts'=>1
   );
  $my_query = new WP_Query($args);
  if( $my_query->have_posts() ) {
    echo "";
    while ($my_query->have_posts()) : $my_query->the_post(); ?>
<div class='tpost'>	
<a href="<?php the_permalink() ?>">
<img width="130" height="200" src="<?php getImage('1'); ?>" alt="<?php the_title(); ?>" />
</a>
<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
</div>  
    <?php endwhile;
    echo "";
  }
}
$post = $original_post;
wp_reset_query();
?>
</div>
<div class="comentarios">
<?php comments_template(); ?>
</div>
<?php endwhile; else: ?>
		<h1>Nada encontrado.</h1>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>

Como puedes ver tengo 4 <?php the_title(); ?>
 
Cambia esto

Insertar CODE, HTML o PHP:
<h2 class="titulo"><a href="<?php the_permalink() ?>"  title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>

Por esto

Insertar CODE, HTML o PHP:
<h1 class="titulo"><a href="<?php the_permalink() ?>"  title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>
Pues esto es lo que tengo en en single:



Como puedes ver tengo 4 <?php the_title(); ?>
 
Cambia esto

Insertar CODE, HTML o PHP:
<h2 class="titulo"><a rel="nofollow" href="<?php the_permalink() ?>"  title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>

Por esto

Insertar CODE, HTML o PHP:
<h1 class="titulo"><a rel="nofollow" href="<?php the_permalink() ?>"  title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>

Muy bien si funcionó, pero ahora tengo un problema, me despareció la parte de arriba de la web, pero creo que fue otra cosa que toqué :fatigue:
 
Debes de haber tocado el Header.php 😕
Muy bien si funcionó, pero ahora tengo un problema, me despareció la parte de arriba de la web, pero creo que fue otra cosa que toqué :fatigue:
 
Debes de haber tocado el Header.php 😕

Ya lo resolví, una ultima pregunta, como hago para que el titulo principal de la web sea el <h1> ?

Insertar CODE, HTML o PHP:
<?php get_header(); ?>
<div id="contenido">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
		     <div class="pelicula" id="post-<?php the_ID(); ?>">
<div class="poster marco-sinopsis">
<a href="<?php the_permalink() ?>"><img src="<?php getImage('1'); ?>" alt="<?php the_title(); ?>" width="130" height="200" /></a>
			   		<div class="sinopsis texto">
			<h3><?php the_title(); ?></h3>
				   <?php the_excerpt(); ?>
				   </div>
	<h2><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>			   
</div>
             </div>			 
<?php endwhile; ?>
<div class="clear"></div>
<br/>
<?php if(function_exists('wp_pagenavi')) : ?>
<?php wp_pagenavi() ?>
<?php else : ?>
<b style="background: yellow;">Debes instalar Wp-Pagenavi</b> <a href="http://wordpress.org/extend/plugins/wp-pagenavi/">http://wordpress.org/extend/plugins/wp-pagenavi/</a>
<?php endif; ?>
<br/>
<?php else : ?>
	<h1>Nada encontrado.</h1>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>

Gracias :encouragement:
 
Prueba en el single.php es donde van todas las entradas en wp...
 
Puede que sea dónde dice H3, prueba y luego le das inspeccionar elemento :encouragement:

Ya lo resolví, una ultima pregunta, como hago para que el titulo principal de la web sea el <h1> ?

Insertar CODE, HTML o PHP:
<?php get_header(); ?>
<div id="contenido">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
		     <div class="pelicula" id="post-<?php the_ID(); ?>">
<div class="poster marco-sinopsis">
<a rel="nofollow" href="<?php the_permalink() ?>"><img src="<?php getImage('1'); ?>" alt="<?php the_title(); ?>" width="130" height="200" /></a>
			   		<div class="sinopsis texto">
			<h3><?php the_title(); ?></h3>
				   <?php the_excerpt(); ?>
				   </div>
	<h2><a rel="nofollow" href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>			   
</div>
             </div>			 
<?php endwhile; ?>
<div class="clear"></div>
<br/>
<?php if(function_exists('wp_pagenavi')) : ?>
<?php wp_pagenavi() ?>
<?php else : ?>
<b style="background: yellow;">Debes instalar Wp-Pagenavi</b> <a rel="nofollow" href="http://wordpress.org/extend/plugins/wp-pagenavi/">http://wordpress.org/extend/plugins/wp-pagenavi/</a>
<?php endif; ?>
<br/>
<?php else : ?>
	<h1>Nada encontrado.</h1>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>

Gracias :encouragement:
 
El titulo de la entrada lo cambias en esta linea
<h2><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
te tiene que quedar
<h1><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>
 
Atrás
Arriba