Cómo colocar anuncios de AdSense debajo del primer título

  • Autor Autor r2j
  • Fecha de inicio Fecha de inicio
R

r2j

Lambda
SEO
Hola betas, tengo una duda, quiero colocar la primera entrada de adsense en el primer título, debajo de él. Coloqué el bloque en el index, y ahora me sale en todos los títulos. ¿Qué código hay que poner, para que me salga solo debajo del primer título?
 
es un while en php con un contador.. 🙂 busca bien ahora no me acuerdo el codigo!!
 
Y con el plugin new adman no podes hacerlo, yo uso ese y todo sale bien.
 
Perfecto!!! lo voy a probar.
 
No hace falta plugins compañero, es muy fácil:

PHP:
<?php while ( have_posts() ) : the_post(); ?>
<?php $i++;?>
<?php if($i==1){?>
<!-- aqui publicicdad -->
<?php }?>
<?php endwhile; ?>

Y con este simple código, saldrá la publicidad solo en el primer post de cada página, y en el lugar donde querais. 😉
 
No hace falta plugins compañero, es muy fácil:

PHP:
<?php while ( have_posts() ) : the_post(); ?>
<?php $i++;?>
<?php if($i==1){?>
<!-- aqui publicicdad -->
<?php }?>
<?php endwhile; ?>

Y con este simple código, saldrá la publicidad solo en el primer post de cada página, y en el lugar donde querais. 😉

Lo puse y casi se me daña, te paso el código del index. Gracias por tu ayuda
Insertar CODE, HTML o PHP:
<?php get_header(); ?>

	<div class="grid_11">
	<div id="content">
	<?php if (have_posts()) : ?>

		<?php while (have_posts()) : the_post(); ?>


			
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
			    <h2 class="entry-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>


				<div class="float-left"><span class="postmetadata"><span class="date"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_time(get_option('date_format')); ?></a></span> <?php the_category(' / ') ?> <?php edit_post_link('Edit', ' • ', ''); ?></span></div>  <div class="float-right"><span class="postmetadata"><?php comments_popup_link('No comments', '<span class="date">1</span> comment', '<span class="date">%</span> comments'); ?></span></div>




<?php if ($count == 0) : ?>


<?php endif; $count++; ?>

				<div class="clearfix"></div>
				<div class="entry">
					<?php the_content('Ler mais &rarr;'); ?>
					<?php wp_link_pages( array( 'before' => '<p><span class="tags">Pages:</span>', 'after' => '</p>' ) ); ?>
				</div>
				<div class="clearfix"></div>

			</div>


		<?php endwhile; ?>

		<div class="navigation">
			<div class="alignleft"><?php next_posts_link('&larr; Older Entries') ?></div>
			<div class="alignright"><?php previous_posts_link('Newer Entries &rarr;') ?></div>
			<div class="clearfix"></div>
		</div>
		
		

	<?php else : ?>

		<h2 class="center">Not Found</h2>
		<p class="center">Sorry, but you are looking for something that isn't here.</p>
		<?php //get_search_form(); ?>

	<?php endif; ?>
		

	</div>
	
	</div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>

- - - Actualizado - - -

¿Dónde lo colocarías?
 
PHP:
<?php get_header(); ?>

	<div class="grid_11">
	<div id="content">
	<?php if (have_posts()) : ?>

		<?php while (have_posts()) : the_post(); ?>
                <?php $i++;?>


			
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
			    <h2 class="entry-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

				<div class="float-left"><span class="postmetadata"><span class="date"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_time(get_option('date_format')); ?></a></span> <?php the_category(' / ') ?> <?php edit_post_link('Edit', ' • ', ''); ?></span></div>  <div class="float-right"><span class="postmetadata"><?php comments_popup_link('No comments', '<span class="date">1</span> comment', '<span class="date">%</span> comments'); ?></span></div>


<?php if($i==1){?>
<!-- aqui publicicdad -->
<?php }?>

<?php if ($count == 0) : ?>


<?php endif; $count++; ?>

				<div class="clearfix"></div>
				<div class="entry">
					<?php the_content('Ler mais &rarr;'); ?>
					<?php wp_link_pages( array( 'before' => '<p><span class="tags">Pages:</span>', 'after' => '</p>' ) ); ?>
				</div>
				<div class="clearfix"></div>

			</div>


		<?php endwhile; ?>

		<div class="navigation">
			<div class="alignleft"><?php next_posts_link('&larr; Older Entries') ?></div>
			<div class="alignright"><?php previous_posts_link('Newer Entries &rarr;') ?></div>
			<div class="clearfix"></div>
		</div>
		
		

	<?php else : ?>

		<h2 class="center">Not Found</h2>
		<p class="center">Sorry, but you are looking for something that isn't here.</p>
		<?php //get_search_form(); ?>

	<?php endif; ?>
		

	</div>
	
	</div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>

De esta forma, tendras la publicidad debajo del título, puedes editar y colocarla donde quieras. 😉
 
PHP:
<?php get_header(); ?>

	<div class="grid_11">
	<div id="content">
	<?php if (have_posts()) : ?>

		<?php while (have_posts()) : the_post(); ?>
                <?php $i++;?>


			
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
			    <h2 class="entry-title"><a rel="nofollow" href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

				<div class="float-left"><span class="postmetadata"><span class="date"><a rel="nofollow" href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_time(get_option('date_format')); ?></a></span> <?php the_category(' / ') ?> <?php edit_post_link('Edit', ' • ', ''); ?></span></div>  <div class="float-right"><span class="postmetadata"><?php comments_popup_link('No comments', '<span class="date">1</span> comment', '<span class="date">%</span> comments'); ?></span></div>


<?php if($i==1){?>
<!-- aqui publicicdad -->
<?php }?>

<?php if ($count == 0) : ?>


<?php endif; $count++; ?>

				<div class="clearfix"></div>
				<div class="entry">
					<?php the_content('Ler mais →'); ?>
					<?php wp_link_pages( array( 'before' => '<p><span class="tags">Pages:</span>', 'after' => '</p>' ) ); ?>
				</div>
				<div class="clearfix"></div>

			</div>


		<?php endwhile; ?>

		<div class="navigation">
			<div class="alignleft"><?php next_posts_link('← Older Entries') ?></div>
			<div class="alignright"><?php previous_posts_link('Newer Entries →') ?></div>
			<div class="clearfix"></div>
		</div>
		
		

	<?php else : ?>

		<h2 class="center">Not Found</h2>
		<p class="center">Sorry, but you are looking for something that isn't here.</p>
		<?php //get_search_form(); ?>

	<?php endif; ?>
		

	</div>
	
	</div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>

De esta forma, tendras la publicidad debajo del título, puedes editar y colocarla donde quieras. 😉

Que grande eres, gracias por tu ayuda compañero!
 
No hace falta plugins compañero, es muy fácil:

PHP:
<?php while ( have_posts() ) : the_post(); ?>
<?php $i++;?>
<?php if($i==1){?>
<!-- aqui publicicdad -->
<?php }?>
<?php endwhile; ?>

Y con este simple código, saldrá la publicidad solo en el primer post de cada página, y en el lugar donde querais. 😉

Lo implementé y me funcionó, gracias :encouragement:
 
Perfecto [MENTION=19022]Prodygy[/MENTION] y [MENTION=24960]Unavision[/MENTION], me alegro que les sirba, yo es que prefiero "meterle mano yo" que instalar un plugin. 🙂
 
Atrás
Arriba