Archive for 'wordpress'


Creare un pannello opzioni personalizzato con Wordpress 2.9

Posted on 10. Jan, 2010 by daniele.

0

In questo tutorial useremo un pannello di opzioni personalizzate per inserire i codici di monitoraggio analitycs. Questo sarà possibile grazie a Wordpress 2.9 che mette a disposizione queste funzionalità.

Link: http://buildinternet.com/2010/01/create-custom-option-panels-with-wordpress-2-9/

Continue Reading

Creare una sezione “Info Autore” su Wordpress!

Posted on 25. Nov, 2009 by daniele.

0

Profilo autore

Diventa sempre più comune trovare alla fine di ogni articolo il profilo dell'autore che ha pubblicato l'articolo. Se volete implementarlo anche voi sul vostro blog seguite il tutorial che vi proponiamo oggi!

STILE CSS

 
#main div#author-info {
	background: #eaeaec; padding: 10px; margin: 0 0 15px 0;
	-moz-border-radius: 8px;
	-webkit-border-radius: 8px;
	border-radius: 8px;
	overflow: auto;
}
	#main div#author-info div#author-image {
		float: left; margin: 0 10px 5px 0; border: 5px solid #DCDCE1;
	}
 

HTML + TAG WORDPRESS

 
<div id="author-info">
<div id="author-image">
    	<a href="<?php the_author_meta('user_url'); ?>">< ?php echo get_avatar( get_the_author_meta('user_email'), '80', '' ); ?></a>
    </div>
<div id="author-bio">
<h4>Written by < ?php the_author_link(); ?></h4>
 
< ?php the_author_meta('description'); ?>
</div>
</div>
 
<!--Author Info-->
 

Continue Reading

34 blog creativi e di alto design!

Posted on 09. Oct, 2009 by daniele.

0

ayame-creative

Godetevi questa raccolta di 34 blog Wordpress di alto design, ottimo per prendere ispirazioni!

Link: http://www.queness.com/post/775/34-fresh-and-creative-wordpress-blog-design

Continue Reading

[Wordpress] Creare pagine con queries personalizzate!

Posted on 07. Oct, 2009 by daniele.

0

Il codice che vedete sotto serve a creare delle queries personalizzate su un template.

 
< ?php
/*
Template Name: Demos and Downloads
*/
 
/* helper:  does regex */
function get_content_match($regex,$content) {
	preg_match($regex,$content,$matches);
	return $matches[1];
}
 
/* list of "view demo" posts */
$paged = (get_query_var('paged')) ? (int) get_query_var('paged') : 1;
$demoPosts = new WP_Query('s=view+demo&amp;showposts=10&amp;order=desc&amp;post_status=publish&amp;paged='.$paged);
 
?>
< ?php get_header(); ?>
<h1>Demos &amp; Downloads</h1>
 
< ?php while ($demoPosts->have_posts()) : $demoPosts->the_post(); ?>
< ?php
	$content = get_the_content();
	if(strstr(strtolower($content),'href="http://davidwalsh.name/dw-content/')):
?>
<h1><a href="<?php the_permalink(); ?>">< ?php the_title(''); ?></a></h1>
<p style="padding-bottom:3px;padding-left:5px;">
	< ?php
		$intro = get_content_match('/
 
(.*)< \/p>/isU',$content);
		$image = get_content_match('/src="(.*)" class="image"/isU',$content);
		$link = strip_tags(get_content_match('/href="http:\/\/davidwalsh.name\/dw-content\/(.*)">/isU',$content));
		if($image) { echo '<img src="'.$image.'" class="image" alt="Tutorial Demo" />'; }
		echo $intro;
	?>
 
<div class="demo-actions">
		<a href="<?php the_permalink(); ?>" class="conred">Continue Reading »</a>
		<a href="http://davidwalsh.name/dw-content/<?php echo $link; ?>" class="demo">View Demo</a>
	</div>
 
< ?php endif; ?>
< ?php…

Continue Reading

[Wordpress] Utilizzare campi personalizzati per visualizzare le immagini

Posted on 28. Sep, 2009 by daniele.

0

Questo tips permette di creare un campo personalizzato 'Immagine' che viene ridimensionato con timthumb e in caso di immagine inesistente verrà visualizzata un'immagine alternativa come ad esempio "No image".

< ?php $postimageurl = get_post_meta($post->ID, 'Image', true);

if ($postimageurl) {

?>

<img src="<?php bloginfo(‘template_url’); ?/> /scripts/timthumb.php?src=< ?php echo get_post_meta($post->ID, "Image", true); ?>&h=250&w=250&zc=1" alt="< ?php the_title(); ?>" />

< ?php } else { ?>

<img src="<?php bloginfo('template_url'); ?/>/images/noimage.jpg" alt="No image available" />

< ?php } ?>

Continue Reading

[Wordpress] Visualizzare i post più popolari, in base al numero di commenti

Posted on 27. Sep, 2009 by daniele.

0

Questo plugin permette di visualizzare i post più popolari basandosi sul numero di commenti inseriti. Il plugin è facilmente applicabile sui vostri temi!

<ul>

< ?php $result = $wpdb->get_results("SELECT comment_count,ID,post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 5");

foreach ($result as $post) {

setup_postdata($post);

$postid = $post->ID;

$title = $post->post_title;

$commentcount = $post->comment_count;

if ($commentcount != 0) { ?>

<li><a href="<?php echo get_permalink($postid); ?>" title="< ?php echo $title ?>">

< ?php echo $title ?></a> {< ?php echo $commentcount ?>}</li>

< ?php } } ?>

</ul>

Continue Reading