Vai al contenuto

Problema visualizzazione WordPress in Safari. [risolto]


UaCK!

Messaggi raccomandati

EDIT: PROBLEMA RISOLTO

Ciao a tutti,

sto sviluppando (gratis) un tema Wordpress per un festival (sempre gratis) organizzato dalla mia università, come base di partenza ho deciso di usare il tema SandBox (un tema "nudo").

Rispetto al tema base ho aggiunto tra header e container ho aggiunto un loop che prende automaticamente la prima immagine dai post di una categoria per creare delle thumbnails.

Questo il codice di questo loop

<div class="thumb">
<?php query_posts('cat=3&showposts=10'); ?>
<?php while (have_posts()) : the_post(); ?>
<!-- get the thumbnail -->
<?php
//Get images attached to the post
$img = null;
$args = array(
'post_type' => 'attachment',
'post_mime_type' => 'image',
'numberposts' => -1,
'order' => 'ASC',
'post_status' => null,
'post_parent' => $post->ID
);
$attachments = get_posts($args);
if ($attachments) {
foreach ($attachments as $attachment) {
$img = wp_get_attachment_thumb_url( $attachment->ID );
break;
} ?>
<!-- ***** THE ACTUAL IMAGE ***** -->

<!-- # if post has an image # -->
<span class="the-thumbnail">
 <a href="<?php the_permalink(); ?>">
   <img src="<?php echo $img; ?>" id="home"  />
 </a>
</span>
<!-- # END if post has an image # -->

<!-- # if post doesn't have an image -->
<?php } else { ?>
<span class="the-thumbnail">
<a href="<?php the_permalink(); ?>">
<img src="http://teachme6.org/wp-content/plugins/sideposts/noth.gif" id="home" />

<!-- CAMBIARE QUI IMMAGINE SEGNAPOSTOOOO -->

</a>
</span>
<!-- # END if post doesn't have an image -->

<!-- ***** END THE ACTUAL IMAGE ***** -->
<?php }
?>
<!-- end get the thumbnail -->

<!--p><!--a href="<!--?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><!--?php the_title(); ?><!--/a><!--/p>
<?php endwhile; ?>

    </div>

il problema è che una volta inserito questo codice tra header e container la visualizzazione in Safari e Opera cambia stranamente mentre in Firefox no.

Ecco come viene visualizzato i Firefox (e cioè come dovrebbe essere visualizzato)

(Content è stato colorato di marrone, sidebars di verde e footers di blu)

http://i17.photobucket.com/albums/b80/Stage6/Schermata2009-09-01a170505.png

Ed ecco come viene visualizzato in Safari

(Content è stato colorato di marrone, sidebars di verde e footers di blu)

http://i17.photobucket.com/albums/b80/Stage6/Schermata2009-09-01a170527.png

Praticamente content e container spariscono assieme a sidebars, e il footers finisce tutto sulla sinistra.

Ho provato ogni modifica via css, per poi scoprire che togliendo il loop delle immagini tutto torna normale.

Sapete aiutarmi?

Ecco il codice della pagina completo

<?php get_header() ?>


<?php query_posts('cat=3&showposts=10'); ?>
<?php while (have_posts()) : the_post(); ?>
<!-- get the thumbnail -->
<?php
//Get images attached to the post
$img = null;
$args = array(
'post_type' => 'attachment',
'post_mime_type' => 'image',
'numberposts' => -1,
'order' => 'ASC',
'post_status' => null,
'post_parent' => $post->ID
);
$attachments = get_posts($args);
if ($attachments) {
foreach ($attachments as $attachment) {
$img = wp_get_attachment_thumb_url( $attachment->ID );
break;
} ?>
<!-- ***** THE ACTUAL IMAGE ***** -->

<!-- # if post has an image # -->
<span class="the-thumbnail">
 <a href="<?php the_permalink(); ?>">
   <img src="<?php echo $img; ?>" id="home"  />
 </a>
</span>
<!-- # END if post has an image # -->

<!-- # if post doesn't have an image -->
<?php } else { ?>
<span class="the-thumbnail">
<a href="<?php the_permalink(); ?>">
<img src="http://teachme6.org/wp-content/plugins/sideposts/noth.gif" id="home" />

<!-- CAMBIARE QUI IMMAGINE SEGNAPOSTOOOO -->

</a>
</span>
<!-- # END if post doesn't have an image -->

<!-- ***** END THE ACTUAL IMAGE ***** -->
<?php }
?>
<!-- end get the thumbnail -->

<!--p><!--a href="<!--?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><!--?php the_title(); ?><!--/a><!--/p>
<?php endwhile; ?>






<div id="container">
	<div id="content">
		<div id="nav-above" class="navigation">
			<div class="nav-previous"><?php next_posts_link(__( '<span class="meta-nav">«</span> Older posts', 'sandbox' )) ?></div>
			<div class="nav-next"><?php previous_posts_link(__( 'Newer posts <span class="meta-nav">»</span>', 'sandbox' )) ?></div>
		</div>
<?php query_posts('cat=4&showposts='.get_option('posts_per_page')); ?>
<?php while ( have_posts() ) : the_post() ?>

		<div id="post-<?php the_ID() ?>" class="<?php sandbox_post_class() ?>">
			<h2 class="entry-title"><a href="<?php the_permalink() ?>" title="<?php printf( __('Permalink to %s', 'sandbox'), the_title_attribute('echo=0') ) ?>" rel="bookmark"><?php the_title() ?></a></h2>
			<div class="entry-date"><abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO') ?>"><?php unset($previousday); printf( __( '%1$s – %2$s', 'sandbox' ), the_date( '', '', '', false ), get_the_time() ) ?></abbr></div>
			<div class="entry-content">
<?php the_content( __( 'Read More <span class="meta-nav">»</span>', 'sandbox' ) ) ?>

			<?php wp_link_pages('before=<div class="page-link">' . __( 'Pages:', 'sandbox' ) . '&after=</div>') ?>
			</div>
			<div class="entry-meta">
				<span class="author vcard"><?php printf( __( 'By %s', 'sandbox' ), '<a class="url fn n" href="' . get_author_link( false, $authordata->ID, $authordata->user_nicename ) . '" title="' . sprintf( __( 'View all posts by %s', 'sandbox' ), $authordata->display_name ) . '">' . get_the_author() . '</a>' ) ?></span>

			</div>
		</div><!-- .post -->

<?php comments_template() ?>

<?php endwhile; ?>

		<div id="nav-below" class="navigation">
			<div class="nav-previous"><?php next_posts_link(__( '<span class="meta-nav">«</span> Older posts', 'sandbox' )) ?></div>
			<div class="nav-next"><?php previous_posts_link(__( 'Newer posts <span class="meta-nav">»</span>', 'sandbox' )) ?></div>
		</div>

	</div><!-- #content -->
</div><!-- #container -->

<?php get_sidebar() ?>
<?php get_footer() ?>

e questo è il link al sito in costruzione

EDIT:PROBLEMA RISOLTO

war is peace

freedom is slavery

ignorance is strength

Link al commento
Condividi su altri siti

Archiviato

Questa discussione è archiviata e chiusa a future risposte.

×
×
  • Crea Nuovo...