Immagine di articolo nella sidebar
-
-
ho visto che c'è il link della foto, ma non me lo da, ti copio il codice della index, forse lo indica in maniera diversa, perchè esce tutto tranne la foto
<?php /** * Template: Index.php * * @package RedLine * @subpackage Template */ get_header(); ?> <!--BEGIN #primary .hfeed--> <div id="primary" class="hfeed" role="main"> <?php if ( have_posts() ) : ?> <?php while ( have_posts() ) : the_post(); ?> <!--BEGIN .hentry--> <article id="post-<?php the_ID(); ?>"><div class="<?php semantic_entries(); ?>"> <header class="post-title"><h2 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php _e( 'Permanent Link to' ,'redline' );?> <?php the_title(); ?>"><?php the_title(); ?></a></h2></header> <!--BEGIN .entry-meta .entry-header--> <section class="meta-header"><div class="entry-meta entry-header"> <span class="published"> <abbr class="published-time" title="<?php the_time( get_option( 'date_format' ) .' - '. get_option( 'time_format' ) ); ?>"><?php the_time( get_option( 'date_format' ) ); ?></abbr></span> | <?php _e( 'Author:', 'redline' );?> <span class="author vcard"> <?php printf( '<a class="url fn" href="' . get_author_posts_url( $authordata->ID, $authordata->user_nicename ) . '" title="' . sprintf( __( 'View all posts by %s', 'redline' ), $authordata->display_name ) . '">' . get_the_author() . '</a>' ) ?></span> <?php edit_post_link( __( 'edit', 'redline' ), '<span class="edit-post">[', ']</span>' ); ?> </div></section><!--END .entry-meta .entry-header--> <!--BEGIN .entry-content--> <div class="entry-content"> <?php the_post_thumbnail(); ?><?php the_content( __( 'Read more', 'redline' ) . ' »' ); ?><div class="clearfix"></div> <?php wp_link_pages( array( 'before' => '<div id="page-links"><p><strong>' . __( 'Pages:', 'redline' ) . '</strong> ', 'after' => '</p></div>', 'next_or_number' => 'number' ) ); ?> </div><!--END .entry-content--> <!--BEGIN .entry-meta .entry-footer--> <section class="meta-footer"><div class="entry-meta entry-footer"> <span class="entry-categories"><?php _e( 'Posted in', 'redline' );?> <?php echo framework_get_terms( 'cats' ); ?></span> <span class="meta-sep">|</span> <span class="comment-count"><a href="<?php comments_link(); ?>"><?php comments_number( __( 'Leave a Comment', 'redline' ), __( '1 Comment', 'redline' ), __( '% Comments', 'redline' ) ); ?></a></span> </div></section><!--END .entry-meta .entry-footer--> </div></article><!--END .hentry--> <?php endwhile; ?> <?php get_template_part( 'navigation' ) ?> <?php else : ?> <!--BEGIN #post-0--> <div id="post-0" class="<?php semantic_entries(); ?>"> <h2 class="entry-title"><?php _e( 'Not Found', 'redline' );?></h2> <!--BEGIN .entry-content--> <div class="entry-content"> <p><?php _e( "Sorry, but you are looking for something that isn't here.", 'redline' );?></p> <?php get_search_form(); ?> <!--END .entry-content--> </div> <!--END #post-0--> </div> <?php endif; ?> </div><!--END #primary .hfeed--> <?php get_sidebar(); ?> <?php get_footer(); ?> -
-
-
-
c'è qualche errore da qualche parte, hai visto il codice che ho postato? Mandami proprio il tuo codice, elimino tutto e inserisco solo il tuo.
Scusami, penso che il problema è proprio quella miniatura, che io non ho, l'immagine più piccola che ho è 150, quella non va proprio
-
-
-
-
-
Prova ad inserire in sidebar.php dopo la riga:
<div id="secondary" class="aside" role="complementary">il codice seguente:
<h3 class="widget-title"><?php _e( 'Ultimi post', 'redline' );?></h3> <ul> <?php query_posts('showposts=5'); ?> <?php while ( have_posts() ) : the_post(); ?> <li> <div class="thumbpost"> <?php if(has_post_thumbnail()) { the_post_thumbnail( array(40,40) ); } ?> </div> <h4 class="alignleft"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permalink a <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h4><br /> <span class="minitxt"><?php the_time('d F Y'); ?> postato da <?php the_author(); ?></span> </li> <?php endwhile; ?> </ul>Naturalmente dovrai mettere a posto il css.
-
-
-
-
-
-
-
-
Usando the_content nel loop (da come vedo nel file index.php che hai postato) la foto dovrebbe venire inserita automaticamente...probabile che oltre a quella venga inserita anche l'immagine in evidenza, in tal caso se vuoi eliminarla cancella <?php the_post_thumbnail(); ?>.
Ciao! Sembra che tu sia interessato a questa conversazione, ma non hai ancora un account.
Stanco di dover scorrere gli stessi post a ogni visita? Quando registri un account, tornerai sempre esattamente dove eri rimasto e potrai scegliere di essere avvisato delle nuove risposte (tramite email o notifica push). Potrai anche salvare segnalibri e votare i post per mostrare il tuo apprezzamento agli altri membri della comunità.
Con il tuo contributo, questo post potrebbe essere ancora migliore 💗
Registrati Accedi

