Suporte » Ajustando o WordPress » Erro single.php

  • Esse é o erro:

    Parse error: syntax error, unexpected 'else' (T_ELSE) in C:\wamp\www\wordpress\wp-content\themes\MaisPress2.0.1\single.php on line 344
    Call Stack
    # Time Memory Function Location
    1 0.0000 134392 {main}( ) ..\index.php:0
    2 0.0000 136328 require( 'C:\wamp\www\wordpress\wp-blog-header.php' ) ..\index.php:17
    3 0.5300 11884416 require_once( 'C:\wamp\www\wordpress\wp-includes\template-loader.php' ) ..\wp-blog-header.php:16

    E esse é o codigo:

    <?php
    get_header(); 
    
    require('keys.php'); ?>
    <!-- breadcrumb -->
    <div class="breadcrumb">
    	<?php seobreadcrumbs();?>
    
        <span style="float:right; margin:-15px 0 0 0;"><?php edit_post_link('Editar');?></span>
    </div>
    <!-- fim breadcrumb -->
    
    <div class="doble-dote" style="margin:0 0 20px 0;"></div>
    
    <!-- esquerda -->
    <div class="esquerda">
    
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post();
    	setPostViews($post->ID);
    	/* ----  TIPO POST  ---- */
    	$tipo_post = get_post_meta($post->ID, 'tipo_post', true);
    
    	if($tipo_post == 'video') {
    		/* ----  THUMBNAIL  ---- */
    		$thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), 'post_capa');
    
    		/* ----  INFO VIDEO  ---- */
    		$capa = get_post_meta($post->ID, 'capa', true);
    		$tempo = get_post_meta($post->ID, 'tempo', true);
    		$lancamento = get_post_meta($post->ID, 'lancamento', true);
    		$audio = get_post_meta($post->ID, 'audio', true);
    		$trailer = get_post_meta($post->ID, 'trailer', true);
    		$esconder_trailer = get_post_meta($post->ID,'esconder_trailer_rodape', true);
    
    		/* ----  DOWN LINKS  ---- */
    		$esconder_download = get_post_meta($post->ID, 'esconder_lista_download', true);
    		$servidor_download = get_post_meta($post->ID, 'servidor_download', true);
    
    		/* ----  VIDEO EMBEDS  ---- */
    		$esconder_assistir = get_post_meta($post->ID, 'esconder_lista_assistir', true);
    		$servidor_assistir = get_post_meta($post->ID, 'servidor_assistir', true);
    	}
    ?>
    
    <?php
    /* ---------------------------------------------------------
    	/   VERIFICA VIDEO   /
    --------------------------------------------------------- */
    if($tipo_post == 'video') {?>
    <!--
    /* ---------------------------------------------------------
    	/   VIDEO   /
    --------------------------------------------------------- */
    -->
    
    <article>
    <!-- videos servidores -->
    <div class="tabs">
       	<!-- embed videos -->
       	<div class="embeds-servidores">
    	<?php
    	if(is_array($servidor_assistir)) {
    	$i = 1; foreach ($servidor_assistir as $embed) {
    
    		if($embed != '') {
    
    		echo '<div class="embeds-video">';
    		echo stripslashes($embed);
    		echo '</div>';
    		$i++;
    
    		}
    	}
    	}
    	?>
       	</div>
       	<!-- fim embed videos -->
    
        <?php if($esconder_assistir != 1) {?>
       	<!-- title -->
       	<div class="clear"></div>
       	<?php if(is_array($servidor_assistir)) {?>
       	<span class="assistir-title play-ico open-sans">
       		Assistir Filme
       	</span>
       	<?php }?>
       	<!-- fim title -->
    
       	<div class="clear"></div>
    
       	<!-- links servidores -->
       	<ul class="links-servidores">
       	<?php
        if(is_array($servidor_assistir)) {
    	$i = 1; foreach ($servidor_assistir as $servidor) {
    
    		if($servidor != '') {
    
    		if($i==1) {
    		echo '<li class="active">';
    		} else {
    		echo '<li>';
    		}
    		echo '<span name="tabs-'.$i.'" class="link-servidor pfregular block">Assistir Server '.$i.'<span class="arrow-assistir"></span></span>';
    		echo '</li>';
    		$i++;
    
    		}
    	}
        }
    	?>
    	</ul>
        <!-- fim links servidores -->
        <?php }?>
    </div>
    <!-- fim videos servidores -->
    
    <?php if(is_array($servidor_assistir)) {?>
    <div class="clear"></div>
    <div class="doble-dote" style="margin:0 0 15px 0;"></div>
    <?php }?>
    
    <?php if($esconder_download != 1) {?>
    <!-- baixar links -->
    <div class="baixar-links">
       <!-- title -->
       <?php if(is_array($servidor_download)) {?>
       <span class="assistir-title down-ico open-sans">
       BAIXAR FILME
       </span>
       <?php }?>
       <!-- fim title -->
    
       <div class="clear"></div>
    
       <!-- links download -->
       <ul class="links-servidores download-lista">
       <?php
       	if(is_array($servidor_download)) {
    	$i = 1;
    	foreach ($servidor_download as $servidor) {
    		if($servidor != '') {
    
    		$url = $servidor;
    		$parse = parse_url($url);
    
    		echo '<li class="tooltip2" title="'.$parse['host'].'">';
    		echo '<a href="'.$servidor.'" target="_blank"><span name="tabs-'.$i.'" class="link-servidor pfregular block">Servidor '.$i.'<span class="arrow-assistir"></span></span></a>';
    		echo '</li>';
    
    		$i++;
    
    		}
    	}
    	}
    	?>
    	</ul>
    	<!-- fim links download -->
    </div>
    <!-- links baixar -->
    
    <div class="clear"></div>
    <div class="doble-dote" style="margin:30px 0 10px 0;"></div>
    <?php }?>
    
    <!-- infos video -->
    <?php if($tempo) {?>
    <span class="info-video open-sans tempo-video">
    	<strong>Tempo:</strong> <?php echo $tempo;?>
    </span>
    <?php }?>
    
    <?php if($lancamento) {?>
    <span class="info-video open-sans lancamento-video">
    	<strong>Lançamento:</strong> <?php echo $lancamento;?>
    </span>
    <?php }?>
    
    <?php if($audio) {?>
    <span class="info-video open-sans audio-video">
    	<strong>Áudio:</strong> <?php echo $audio;?>
    </span>
    <?php }?>
    
    <span class="info-video open-sans visitas-video">
    	<strong>Visitas:</strong> <?php echo getPostViews(get_the_ID());?>
    </span>
    <!-- infos video -->
    
    <div class="clear"></div>
    <div class="doble-dote" style="margin:10px 0 15px 0;"></div>
    
    <!-- capa single -->
    <div class="capa-single">
    	<img src="<?php if(has_post_thumbnail()) { echo $thumbnail[0]; } elseif($capa) { echo $capa;} else {?><?php bloginfo('template_directory');?>/images/capa.jpg<?php }?>" alt="<?php the_title();?>" />
    </div>
    <!-- fim capa single -->
    
    <!-- content single -->
    <div class="content content-single">
    	<?php the_content();?>
    </div>
    <!-- fim content single -->
    
    <div class="clear"></div>
    <div class="doble-dote" style="margin:15px 0 10px 0;"></div>
    
    <!-- infos video -->
    <span class="info-video open-sans categoria-video">
    	<strong>Categorias:</strong> <?php the_category(', ');?>
    </span>
    
    <span class="info-video open-sans tag-video">
    	<?php the_tags('<strong>Tags:</strong> ', ', ');?>
    </span>
    <!-- infos video -->
    </article>
    
    <div class="clear"></div>
    <div class="doble-dote" style="margin:10px 0 35px 0;"></div>
    
    <!-- relacionados -->
    <div <?php if($esconder_trailer != 1 && $trailer) { echo 'class="coll-relacionados-trailer"';}?>>
       	<span class="assistir-title relacionados-ico open-sans" style="border-bottom:1px solid #e7e7e7; padding:0 0 5px 35px; margin:0 0 15px 0; display:block;">
       	RELACIONADOS
       	</span>
    
    	<!-- relacionados lista -->
        <div class="flexslider <?php if($esconder_trailer != 1 && $trailer) { echo 'slider-relacionados'; } else { echo 'slider-relacionados-full'; }?>">
    	<?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'=> 10,
                'caller_get_posts'=>1,
                'orderby' => 'rand'
            );
    
            $my_query = new wp_query( $args );
            if( $my_query->have_posts() ) {
    			$i=0;
                echo '<ul class="slides lista-filmes-relacionados" style="background:none;">';
                while( $my_query->have_posts() ) {
                    $my_query->the_post();
    
    				$thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), 'post_capa');
    				$capa = get_post_meta($post->ID, 'capa', true);
    				?>
        <li <?php if($esconder_trailer != 1 && $trailer) { if($i%2 == 0) { echo 'style="padding:0px; margin:0 !important; width:170px;"';} else { echo 'style="padding:0 0 0 10px; margin:0 !important; width:160px !important;"'; }} else { echo 'style="padding:0 0 0 10px; margin:0 !important; width:165px !important;"';}?>>
            <div class="box">
                <!-- titulo box -->
                <div class="titulo-box open-sans">
                    <h2 class="titulo-box-link">
                    <a href="<?php the_permalink();?>" title="<?php the_title();?>" <?php if (strlen($post->post_title) > 21) {echo 'class="tooltip"'; }?>><?php if (strlen($post->post_title) > 21) {echo substr(the_title($before = '', $after = '', FALSE), 0, 21) . '...'; } else {the_title();} ?></a>
                    </h2>
                </div>
                <!-- fim titulo box -->
    
                <div class="clear"></div>
    
                <!-- capa -->
                <div class="capa">
                <a href="<?php the_permalink();?>" class="absolute-capa no-text"><?php the_title();?></a>
                <img src="<?php if(has_post_thumbnail()) { echo $thumbnail[0]; } elseif($capa) { echo $capa;} else {?><?php bloginfo('template_directory');?>/images/capa.jpg<?php }?>" alt="<?php the_title();?>" />
                </div>
                <!-- fim capa -->
    
                <div class="clear"></div>
    
                <!-- views -->
                <div class="views">
                <?php echo getPostViews(get_the_ID());?> visitas
                </div>
                <!-- fim views -->
    
                <!-- balao comentario -->
                <div class="balao-comentario">
                <?php comments_popup_link('0','1', '%', '','-'); ?>
                </div>
                <!-- fim balao comentario -->
    
            </div>
        </li>
        <? $i++;
            }
                echo '</ul>';
            }
        }
        $post = $orig_post;
        wp_reset_query();
        ?>
        </div>
        <!-- relacionados lista -->
    </div>
    <!-- fim relacionados -->
    
    <?php if($esconder_trailer != 1 && $trailer) {?>
    <!-- trailer -->
    <div class="coll-relacionados-trailer" style="float:right;">
    
       	<span class="assistir-title trailer-ico open-sans" style="border-bottom:1px solid #e7e7e7; padding:0 0 5px 30px; margin:0 0 15px 0; display:block;">
       	Trailer
       	</span>
    
    	<!-- embed trailer -->
        <div class="embed-trailer">
        <?php echo stripslashes($trailer);?>
        </div>
        <!-- fim embed trailer -->
    
    </div>
    <!-- fim trailer -->
    <?php }?>
    <!--
    /* ---------------------------------------------------------
    	/   FIM VIDEO   /
    --------------------------------------------------------- */
    -->
    <?php } 
    
    /* ---------------------------------------------------------
    	/   SE NÃO INSERE MODELO DE BLOG   /
    --------------------------------------------------------- */
    else() {?>
    <!-- content blog -->
    <div class="content content-blog">
    <?php the_content();?>
    </div>
    <!-- fim content blog -->
    
    <div class="clear"></div>
    <div class="doble-dote" style="margin:15px 0 10px 0;"></div>
    
    <!-- infos video -->
    <span class="info-video open-sans categoria-video">
    	<strong>Categorias:</strong> <?php the_category(', ');?>
    </span>
    
    <span class="info-video open-sans tag-video">
    	<?php the_tags('<strong>Tags:</strong> ', ', ');?>
    </span>
    <!-- infos video -->
    <div class="clear"></div>
    <div class="doble-dote" style="margin:10px 0 35px 0;"></div>
    <?php } ?>
    
    <?php endwhile; ?>
    
    <div class="clear"></div>
    
    <!-- comentarios -->
    <div class="comentarios">
    	<?php comments_template();?>
    </div>
    <!-- fim comentarios -->
    
    <?php else : ?>
    
    <?php endif; ?>
    
    </div>
    <!-- fim esquerda -->
    
    <!-- direita -->
    <div class="direita">
    <?php require('sidebar.php');?>
    </div>
    <!-- fim direita -->
    
    <?php get_footer();?>

    Ficarei grato pela ajuda…

Visualizando 1 resposta (de um total de 1)
  • acredito que o erro seja esse:
    na linha 333 você esta usando else assim:
    else() tente substituir por:
    else{
    código
    }
    ou por:
    elseif(‘aqui você coloca a condição’){
    código
    }

    obs: o else você não pode usar assim: else() só pode ser usado assim else{}

Visualizando 1 resposta (de um total de 1)
  • O tópico ‘Erro single.php’ está fechado para novas respostas.