Error de análisis: error de sintaxis, final de archivo inesperado
25 abr 2014, 00:37:33
Vistas: 16.6K
Votos: 0
Estoy obteniendo este error al cargar mi página PHP:
Parse error: syntax error, unexpected end of file in /Applications/XAMPP/xamppfiles/htdocs/wordpress2/wp-content/themes/annonciation/page-42.php on line 77
Entiendo que significa que he abierto algún corchete o paréntesis en algún lugar y no lo he cerrado, pero ¡no logro encontrarlo! Aquí está mi código:
<?php get_header();?>
<div id="container">
<!-- Glosario -->
<p class="titrep" style="padding-top:192px;">- Glosario -</p>
<div id="alphabet">
<ul>
<?php
foreach(range('A','Z') as $i) {?>
<li>
<?php echo $i;?>
</li>
<?php
if($i=='Z')
{
break;
}
else{
?>
<li>.</li>
<?php }
}
?>
</ul>
</div>
<div id="mots">
<?php //$test=new WP_Query(array('post_type'=>'mots')); ?>
<?php //while ( $test -> have_posts() ) : $test -> the_post();?>
<?php
$args = array(
'post_type'=> 'mots',
'lettres' => 'alpha',
'order' => 'ASC'
);
$the_query = new WP_Query( $args );
if($the_query->have_posts() ) : {
while ( $the_query->have_posts() ) : $the_query->the_post();
//algún código que seguro no está causando el error (lo eliminé y sigo obteniendo el error)
endwhile;
}?>
</div>
<?php get_footer(); ?>
¿Cuál podría ser el problema?

user1438482
103
Comentarios
Todas las respuestas a la pregunta
3
0
if($the_query->have_posts() ) : {
¿Llaves o sintaxis de dos puntos/fin? Elige uno.
También, aquí hay algo de lectura recomendada.

vancoder
7.91K
25 abr 2014 02:40:56
0
Aquí está la documentación de referencia para el Loop en WordPress. Según esto, si deseas utilizar :
entonces no necesitas usar {}
. Puedes usar uno u otro al mismo tiempo.

Bindiya Patoliya
662
25 abr 2014 07:44:20
Preguntas relacionadas
4
respuestas
2
respuestas
1
respuestas