Visualizzazione post con etichetta Wordpress. Mostra tutti i post
Visualizzazione post con etichetta Wordpress. Mostra tutti i post

sabato 28 maggio 2011

Wordpress google adsense 3 posts

Google Adsense allows 3 ad strips per page as you all know. Generally, Most of the bloggers concentrate on monetizing the single pages of their blogs and leave their homepage clean without ads. If you are one of them who like ads on the Home Page like me, this will help you do it in a better way. Most of us want to show up Google ads in the first 3 posts of the blog as they grab the attention of the readers.

This can be done with a small piece of code, without using any kind of Plugins. So, In order to integrate ads efficiently into your WordPress theme. Open up your index.php file and look for the loop. The loop begins like this..


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



and this loop should end as


<?php endwhile; else: ?>

<p>Sorry, nothing matches that criteria.</p>

<?php endif; ?>



Your Google Adsense code should be placed between the start and the end of this loop. So, just pick a position (after the title or at the end of the content,where ever you want) and place the following code..


<?php if ($wp_query->current_post < 3) { ?>

<!– Google Adsense Code goes here –>

<?php } ?>





Now you have to replace the commented line ( ) with your adsense code, save this file and update your theme. Now your theme should display three units of adsense code in your first 3 posts just like you always wanted.

sabato 2 ottobre 2010

500 internal server error wordpress aruba

Quando avete un hosting linux su Aruba e provate ad aggiornare automaticamente il vostro blog in Wordpress, molto probabilmente vi troverete nella situazione di buoi del vostro sito con l'errore 500 internal server error.
La soluzione a questo problema che sicuramente vi mette non poco ansia è la seguente:

1- aprite il vostro pannello di controllo su Aruba http://admin.aruba.it/login.aspx
2- Pannello di gestione hostinx Linux
3- Strumenti e Impostazioni
4- Riparazione Permissions
5- premete "ok"

Ora non vi resta che aspettare qualche minuto.