| |
— | wordpress:template_pubblicazioni [2012/09/17 22:37] (current) – created gfsadministrator |
---|
| ====== Template Pubblicazioni ====== |
| Per info su questo progetto: **Gioxx** ([[mailto:gioxx@gxware.org|gioxx@gxware.org]])\\ |
| * **In funzione su**: [[http://supportoinformatico.org/pubblicazioni|supportoinformatico.org/pubblicazioni]] |
| * **Utilizza**: codice [[http://codex.wordpress.org/|Codex Wordpress]], sviluppato in origine per [[http://www.web2feel.com/androida-theme/|Wordpress Androida]] poi adattato per diversi temi |
| * **Grazie a**: [[http://iconspedia.com|Iconspedia.com]] per le icone utilizzate |
| * **Ne ho parlato su**: - |
| |
| **Template Pubblicazioni** integra nella pagina gli ultimi 30 articoli pubblicati con data di pubblicazione e autore, i tag utilizzati per tutti gli articoli (limite 0, quindi vengono pubblicati tutti i tag) e gli archivi mensili di pubblicazione. Con delle semplicissime query può integrare meno materiale ma più categorie, come nel caso di [[http://supportoinformatico.org|SupportoInformatico.org]] dove ho voluto mettere in risalto le macro-aree di interesse. |
| |
| ===== Codice sorgente ===== |
| |
| Salvare il file e inserirlo nella cartella **wp-content/themes/androida/** (o equivalente), quindi creare una nuova pagina attraverso l'interfaccia amministrativa del proprio blog / sito web e applicare il template "**Pubblicazioni**". E' sufficiente salvare la pagina (//anche senza inserire alcunché//). |
| |
| <file php template_pubblicazioni.php> |
| <!-- |
| Wordpress Androida |
| Template Pubblicazioni 0.1 |
| Gioxx - gioxx@gxware.org |
| --> |
| <?php /* Template Name: Pubblicazioni */ ?> |
| <?php get_header(); ?> |
| |
| <div id="content"> |
| |
| <div class="single" id="post-<?php the_ID(); ?>"> |
| |
| <div class="title"> |
| <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2> |
| </div> |
| |
| <div class="cover"> |
| <div class="entry"> |
| |
| <!-- gli autori --> |
| <a name="autori"></a><img src="http://supportoinformatico.org/images/groupevent-128.png" align="right" /><h2 style="margin-left: 15px;">Gli autori</h2> |
| <br /><p style="margin-left: 25px;">(i primi 5, in ordine di articoli pubblicati, fare clic sull'autore per vedere la scheda personale)</p> |
| <ul> |
| <?php |
| //con RSS dedicato |
| //wp_list_authors('show_fullname=1&optioncount=1&orderby=post_count&order=DESC&number=5&feed=RSS'); |
| //senza RSS dedicato |
| wp_list_authors('&optioncount=1'); |
| ?> |
| </ul> |
| |
| <div class="clear"></div> |
| |
| <!-- archivio pubblicazioni: limite a 15 --> |
| <a name="ultime"></a><img src="http://supportoinformatico.org/images/edit-128.png" align="right" /><h2 style="margin-left: 15px;">Pubblicazioni recenti</h2> |
| <br /><p style="margin-left: 25px;">(ultime 15 pubblicazioni)</p> |
| <ul> |
| <?php query_posts('showposts=15'); ?> |
| <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> |
| <?php $wp_query->is_home = false; ?> |
| <li><?php the_time('m.d.Y') ?> - <a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li> |
| <?php endwhile; endif; ?> |
| </ul> |
| |
| <div class="clear"></div> |
| |
| <!-- helpdesk primo livello: limite a 5 --> |
| <a name="hdprimo"></a><img src="http://supportoinformatico.org/images/add_user-128.png" align="right" /><h2 style="margin-left: 15px;">HelpDesk Primo Livello</h2> |
| <br /><p style="margin-left: 25px;">(ultime 5 pubblicazioni)</p> |
| <ul> |
| <?php query_posts('cat=54&showposts=5'); ?> |
| <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> |
| <?php $wp_query->is_home = false; ?> |
| <li><?php the_time('m.d.Y') ?> - <a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li> |
| <?php endwhile; endif; ?> |
| </ul> |
| |
| <div class="clear"></div> |
| |
| <!-- controllo remoto: limite a 5 --> |
| <a name="hdprimo"></a><img src="http://supportoinformatico.org/images/agt_update_drivers-128.png" align="right" /><h2 style="margin-left: 15px;">Controllo Remoto</h2> |
| <br /><p style="margin-left: 25px;">(ultime 5 pubblicazioni)</p> |
| <ul> |
| <?php query_posts('cat=3&showposts=5'); ?> |
| <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> |
| <?php $wp_query->is_home = false; ?> |
| <li><?php the_time('m.d.Y') ?> - <a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li> |
| <?php endwhile; endif; ?> |
| </ul> |
| |
| <div class="clear"></div> |
| |
| <!-- prodotti internet: limite a 5 --> |
| <a name="hdprimo"></a><img src="http://supportoinformatico.org/images/about_kde-128.png" align="right" /><h2 style="margin-left: 15px;">Prodotti Internet</h2> |
| <br /><p style="margin-left: 25px;">(ultime 5 pubblicazioni)</p> |
| <ul> |
| <?php query_posts('cat=25&showposts=5'); ?> |
| <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> |
| <?php $wp_query->is_home = false; ?> |
| <li><?php the_time('m.d.Y') ?> - <a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li> |
| <?php endwhile; endif; ?> |
| </ul> |
| |
| <div class="clear"></div> |
| |
| <!-- archivio tag --> |
| <img src="http://supportoinformatico.org/images/Tag_Add_128.png" align="right" /><h2 style="margin-left: 15px;">Tag utilizzati</h2> |
| <br /><p style="margin-left: 25px;">(tutti i tag utilizzati)</p> |
| <div style="margin-left: 20px;"><?php wp_tag_cloud('number=0'); ?></div> |
| |
| <div class="clear" style="margin-bottom: 20px;"></div> |
| |
| <!-- archivio mensile --> |
| <img src="http://supportoinformatico.org/images/Archive-128.png" align="right" /><h2 style="margin-left: 15px;">Archivio pubblicazioni</h2> |
| <br /><p style="margin-left: 25px;">(in ordine per mese)</p> |
| <div style="margin-left: 40px;"><?php wp_get_archives('type=monthly&show_post_count=1') ?></div> |
| |
| <div class="clear" style="margin-bottom: 20px;"></div> |
| |
| <p style="text-align: right;"><span style="color: #c0c0c0; font-size:10px;"><a href="http://dev.gxware.org/wiki/doku.php?id=wordpress:template_pubblicazioni">Template Pubblicazioni</a> realizzato da Gioxx<br />versione modificata per <a href="http://supportoinformatico.org">SupportoInformatico.org</a>, icone <a href="http://www.iconspedia.com/pack/crystal-clear-actions-1303/">Crystal Clear Actions</a></span></p> |
| |
| <div class="clear" style="margin-bottom: 20px;"></div> |
| |
| </div> |
| |
| </div> |
| |
| </div> |
| |
| </div> |
| |
| <?php get_sidebar(); ?> |
| <?php get_footer(); ?> |
| </file> |
| |
| ===== Standard Theme: versione modificata ===== |
| Versione del template appositamente modificata per [[http://gioxx.org|Gioxx's Wall]], perfettamente funzionante e visibile all'indirizzo [[http://gioxx.org/archivioblog/|gioxx.org/archivioblog]]. |
| |
| Le icone vengono caricate da SupportoInformatico.org. La sintassi utilizzata è direttamente presa e adattata dal [[http://codex.wordpress.org/|Codex Wordpress]], contrariamente a SupportoInformatico.org questa non punta a nessuna categoria particolare. Mostra le ultime 30 pubblicazioni (di qualsiasi categoria), 50 tag (//le più utilizzate//), categorie (//elenco in ordine alfabetico e con collegamento al feed RSS dedicato//) e l'archivio mensile delle pubblicazioni (//con menu a tendina, comprensivo del numero articoli pubblicati per ciascun mese//). |
| |
| Qui di seguito il codice sorgente: |
| |
| <file php template_pubblicazioni-Standard.php> |
| <?php /* Template Name: Pubblicazioni Standard Theme */ ?> |
| <?php get_header(); ?> |
| <div id="content" class="col-full"> |
| <div id="main" class="col-left"> |
| <div class="post"> |
| <!--<h2 class="title"><?php //the_title(); ?></h2>--> |
| <p class="post-meta"></p> |
| <div class="entry"> |
| |
| <!-- archivio pubblicazioni: limite a 30 --> |
| <img src="http://supportoinformatico.org/images/edit-128.png" align="right" width="80" height="80" /><h2>Pubblicazioni recenti</h2> |
| <p>(ultime 30)</p> |
| <ul> |
| <?php query_posts('showposts=30'); ?> |
| <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> |
| <?php $wp_query->is_home = false; ?> |
| <li><?php the_time('m.d.Y') ?> - <a href="<?php the_permalink() ?>"><?php the_title(); ?></a> (<?php echo $post->comment_count ?> <?php _e('Comments','standardtheme'); ?>)</li> |
| <?php endwhile; endif; ?> |
| </ul> |
| |
| <div class="clear" style="margin-bottom: 20px;"></div> |
| |
| <!-- archivio tag --> |
| <img src="http://supportoinformatico.org/images/Tag_Add_128.png" align="right" width="80" height="80" /><h2>Tag utilizzati</h2> |
| <p>(i 50 più utilizzati)</p> |
| <div><?php wp_tag_cloud('number=50'); ?></div> |
| |
| <div class="clear" style="margin-bottom: 20px;"></div> |
| |
| <!-- archivio categorie --> |
| <img src="http://supportoinformatico.org/images/bookmark_folder-128.png" align="right" width="80" height="80" /><h2>Categorie</h2> |
| <p>(in ordine alfabetico, con feed RSS dedicato)</p> |
| <ul style="font-variant: small-caps;"> |
| <?php wp_list_categories('orderby=name&show_count=1&feed=RSS'); ?> |
| </ul> |
| |
| <div class="clear" style="margin-bottom: 20px;"></div> |
| |
| <!-- archivio mensile --> |
| <img src="http://supportoinformatico.org/images/Archive-128.png" align="right" width="80" height="80" /><h2>Archivio pubblicazioni</h2> |
| <p>(in ordine per mese)</p> |
| <div> |
| <select name="archive-dropdown" onChange='document.location.href=this.options[this.selectedIndex].value;'> |
| <option value=""><?php echo attribute_escape(__('Seleziona mese')); ?></option> |
| <?php wp_get_archives('type=monthly&format=option&show_post_count=1'); ?> </select> |
| </div> |
| |
| <div class="clear" style="margin-bottom: 70px;"></div> |
| |
| <p style="text-align: right;"><span style="color: #c0c0c0; font-size:10px;"><a href="http://dev.gxware.org/wiki/doku.php?id=wordpress:template_pubblicazioni">Template Pubblicazioni</a> realizzato da Gioxx<br />versione modificata per <a href="http://gioxx.org">Gioxx's Wall</a>, icone <a href="http://www.iconspedia.com/pack/crystal-clear-actions-1303/">Crystal Clear Actions</a></span></p> |
| |
| </div> |
| </div> |
| </div> |
| <?php get_sidebar(); ?> |
| </div> |
| <?php get_footer(); ?> |
| </file> |