• Hola, quería haceros una pregunta porque me estoy volviendo loco. Cuando cambio de la página pincipal de mi web a single.php, se desplaza todo el contenido a la derecha. He descubierto que lo que hace que se mueva es <?php the_content()?>, pero no sé cómo arreglarlo para que no ocurra.

    Os dejo por si acaso los códigos tando de single.php como de index.php. Muchas gracias de antemano y un saludo a todos.

    single.php

    <?php get_header()?>
    	<div id="contentproyecto">
    		<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); //The Loop?>
    		<div <?php post_class()?>>
    			<div class="post-content"><?php the_content()?></div>
    			<?php if(has_tag()){the_tags( _e('Keywords','building-blocks') . ': ', ', ');}?>
    			<?php wp_link_pages() //Page buttons for multi-page posts?>
    	</div>	
    
    	<?php endwhile;endif;?>
    
        <?php $orig_post = $post;
        global $post;
        $categories = get_the_category($post->ID);
        if ($categories) {
        $category_ids = array();
        foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
    
        $args=array(
        'category__in' => $category_ids,
        'post__not_in' => array($post->ID),
        'posts_per_page'=> 4, // Number of related posts that will be shown.
        'caller_get_posts'=>1
        );
    
        $my_query = new wp_query( $args );
        if( $my_query->have_posts() ) {
        echo '<div id="relacionados"><h3>Proyectos relacionados</h3>';
        while( $my_query->have_posts() ) {
        $my_query->the_post();?>
    
        <div class="brick"><a href="<? the_permalink()?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_post_thumbnail(); ?></a>
        <div class="titulo">
        <h3><a href="<? the_permalink()?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
        </div>
        </div>
        <?
        }
        echo '</div>';
        }
        }
        $post = $orig_post;
        wp_reset_query(); ?>
    
    </div>
    	<?php get_sidebar()?>
    
    <?php get_footer()?>

    y aquí el index.php

    <?php get_header()?>
    	<div id="content">
    
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    	 		<div class="brick">
    
    				<a href="<?php the_permalink() ?>" rel="bookmark">
     				   <div class="imagen">
    			           <?php if (has_post_thumbnail()) {
    			 	   the_post_thumbnail(array(215,215));
    			           }?>
    			           </div>
    
    				   <div class="titulo">
    			           <h2><?php the_title(); ?></h2></div></a>
    
    			</div>
    
    		<?php endwhile; endif; ?>
    	</div>
    </div>
    
    <?php get_footer()?>
Viendo 1 respuesta (de un total de 1)
  • Creo que lo ideal seria ver el problema, ojala puedas poner un link al problema para poder opinarte, yo me estoy imaginando que hay un detalle en css

    Saludos.

Viendo 1 respuesta (de un total de 1)
  • El debate ‘me desplaza toda la single.php a la derecha’ está cerrado a nuevas respuestas.