Foros del Web » Creando para Internet » Sistemas de gestión de contenidos » WordPress »

Una de mis paginas tira error parse error

Estas en el tema de Una de mis paginas tira error parse error en el foro de WordPress en Foros del Web. es muy raro.. yo utilizo el siguiente codigo para llamar mis categorias de la base de dato: Código: <h1 class="entry-title"><span class="subtitulos-secciones">Tiempo Libre</span> &raquo; Minibus</h1> <?php ...
  #1 (permalink)  
Antiguo 30/05/2012, 19:38
 
Fecha de Ingreso: enero-2011
Ubicación: Tucuman
Mensajes: 23
Antigüedad: 13 años, 3 meses
Puntos: 0
Una de mis paginas tira error parse error

es muy raro.. yo utilizo el siguiente codigo para llamar mis categorias de la base de dato:

Código:
            <h1 class="entry-title"><span class="subtitulos-secciones">Tiempo Libre</span> &raquo; Minibus</h1>
			<?php $the_query = new WP_Query('category_name=minibus&showposts=-1');
		                while ($the_query->have_posts()) : $the_query->the_post();
		                $do_not_duplicate = $post->ID; ?>
            <div id="container-search-pages">
		                <!-- #thumbnail <?php the_post_thumbnail('large'); ?> -->
                        <strong><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>" class="numeros-de-utilidad-title"><?php the_title(); ?></a></strong>
                        <?php the_content(); ?>
            </div>
                        <?php endwhile;?>
utilizo este codigo en varios page mio y lo repito varias veces en el mismo page sin problema. de esta manera yo llamo diferentes categorias en una misma pagina..

pero en una pagina especial, me tira el siguiente error:

Código:
Parse error: syntax error, unexpected $end in /home/elasesor/public_html/yerbabuena/wp-content/themes/twentyten/page-tiempo-libre.php on line 78
es raro, porque cuando repito el codigo 4 veces, funcionana, pero si agrego una vez mas este llamado, me tira el error!

no hay señal de hackeo, y el error parse por lo que busque dicen que tengo cerrado mal un bracket } ... pero tampoco es el caso, ya que si utilizo la combinacion esa 4 veces funciona perfecto, pero si agrego una quinta llamada, tira el error ese...

esta jodido esto, alguna idea?
  #2 (permalink)  
Antiguo 31/05/2012, 04:25
Avatar de zanguanga
Moderadora
 
Fecha de Ingreso: julio-2009
Ubicación: España
Mensajes: 1.686
Antigüedad: 14 años, 9 meses
Puntos: 429
Respuesta: Una de mis paginas tira error parse error

¿Ya probaste descativando todos los plugins?

Si colocas parte del código que contiene la línea 78 de twentyten/page-tiempo-libre.php, que te indica el mensaje de error, tal vez sea más fácil descubrir algo
__________________
Mi blog personal | Mi G+
  #3 (permalink)  
Antiguo 31/05/2012, 14:40
 
Fecha de Ingreso: enero-2011
Ubicación: Tucuman
Mensajes: 23
Antigüedad: 13 años, 3 meses
Puntos: 0
Respuesta: Una de mis paginas tira error parse error

la linea que dice que tiene error es la siguiente:

Código:
<strong><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>" class="numeros-de-utilidad-title"><?php the_title(); ?></a></strong>
ya desactive todos los plugins y no hace diferencia absoluta.. gracias por su respuesta
  #4 (permalink)  
Antiguo 31/05/2012, 14:58
 
Fecha de Ingreso: enero-2011
Ubicación: Tucuman
Mensajes: 23
Antigüedad: 13 años, 3 meses
Puntos: 0
Respuesta: Una de mis paginas tira error parse error

como dije, es raro, porque yo repito el codigo 4 veces de la siguiente manera:

Código:
<?php
/*
Template Name: Tiempo Libre
*/
?><?php
/**
 * The template for displaying all pages.
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages
 * and that other 'pages' on your WordPress site will use a
 * different template.
 *
 * @package WordPress
 * @subpackage Twenty_Ten
 * @since Twenty Ten 1.0
 */

get_header(); ?>

		<div id="container">
			<div id="content" role="main">

            <h1 class="entry-title">Tiempo Libre</h1> 
                       
            <h1 class="entry-title"><span class="subtitulos-secciones">Tiempo Libre</span> &raquo; Bicicleter&iacute;as</h1>
			<?php $the_query = new WP_Query('category_name=bicicleterias&showposts=-1');
		                while ($the_query->have_posts()) : $the_query->the_post();
		                $do_not_duplicate = $post->ID; ?>
            <div id="container-search-pages">
		                <!-- #thumbnail <?php the_post_thumbnail('large'); ?> -->
                        <strong><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>" class="numeros-de-utilidad-title"><?php the_title(); ?></a></strong>
                        <?php the_content(); ?>
            </div>
                        <?php endwhile;?>


            <h1 class="entry-title"><span class="subtitulos-secciones">Tiempo Libre</span> &raquo; Agencia de Viajes</h1>
			<?php $the_query = new WP_Query('category_name=agencia-de-viajes-agencia-de-viajes&showposts=-1');
		                while ($the_query->have_posts()) : $the_query->the_post();
		                $do_not_duplicate = $post->ID; ?>
            <div id="container-search-pages">
		                <!-- #thumbnail <?php the_post_thumbnail('large'); ?> -->
                        <strong><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>" class="numeros-de-utilidad-title"><?php the_title(); ?></a></strong>
                        <?php the_content(); ?>
            </div>
                        <?php endwhile;?>


            <h1 class="entry-title"><span class="subtitulos-secciones">Tiempo Libre</span> &raquo; Alquiler de 4x4</h1>
			<?php $the_query = new WP_Query('category_name=alquiler-de-4x4&showposts=-1');
		                while ($the_query->have_posts()) : $the_query->the_post();
		                $do_not_duplicate = $post->ID; ?>
            <div id="container-search-pages">
		                <!-- #thumbnail <?php the_post_thumbnail('large'); ?> -->
                        <strong><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>" class="numeros-de-utilidad-title"><?php the_title(); ?></a></strong>
                        <?php the_content(); ?>
            </div>
                        <?php endwhile;?>


            <h1 class="entry-title"><span class="subtitulos-secciones">Tiempo Libre</span> &raquo; Cabalgatas</h1>
			<?php $the_query = new WP_Query('category_name=cabalgatas&showposts=-1');
		                while ($the_query->have_posts()) : $the_query->the_post();
		                $do_not_duplicate = $post->ID; ?>
            <div id="container-search-pages">
		                <!-- #thumbnail <?php the_post_thumbnail('large'); ?> -->
                        <strong><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>" class="numeros-de-utilidad-title"><?php the_title(); ?></a></strong>
                        <?php the_content(); ?>
            </div>
                        <?php endwhile; ?>


			<div id="contenido-buscador" style="margin: 25px 0 30px 0;">
				<?php get_search_form(); ?>
	            </div>
			</div><!-- #content -->
		</div><!-- #container -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>
pero al agregar un 5to parrafo del mencionado a la lista, recien me tira error!! lo mismo me sucede en otros pages en las cuales ya tenia hecho el formato y queria agregar un nuevo parrafo de codigo...
  #5 (permalink)  
Antiguo 01/06/2012, 10:48
Avatar de zanguanga
Moderadora
 
Fecha de Ingreso: julio-2009
Ubicación: España
Mensajes: 1.686
Antigüedad: 14 años, 9 meses
Puntos: 429
Respuesta: Una de mis paginas tira error parse error

Revisa esas querys, por ejemplo para llamar a una categoría usa:

Código PHP:
Ver original
  1. query_posts( array ( 'category_name' => 'The Category Name', 'posts_per_page' => -1 ) );
En http://codex.wordpress.org/Function_..._in_a_Category tienes mas info. Observa que el parámetro es post_per_page y no showposts que está ya obsoleto, como bien nos acaba de recordar metacortex en otro hilo.

Revisa también la función WP Query: http://codex.wordpress.org/Class_Reference/WP_Query por si al usar the_post necesitaras incluir wp_reset_postdata();
__________________
Mi blog personal | Mi G+

Etiquetas: parse, php, post, tira, themes
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 20:15.