Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Trilheiros.net

syntax error, unexpected T_ENDIF

Recommended Posts

Olá! Preciso de ajuda!

 

Meu site (www.trilheiros.net) está fora do ar quando fui incluir um código no meu arquivo functions.php do wordpress. Não fui bem sucedida, tentei voltar mas agora aparece o seguinte erro:

 

Parse error: syntax error, unexpected T_ENDIF in /home/trilh356/public_html/wp-content/themes/smartline-lite/functions.php on line 299

 

Alguém consegue me ajudar? Segue abaixo o final do meu arquivo:

 

 

// Custom Template for comments and pingbacks.
if ( ! function_exists( 'smartline_list_comments' ) ):
function smartline_list_comments($comment, $args, $depth) {
 
$GLOBALS['comment'] = $comment;
 
if( $comment->comment_type == 'pingback' or $comment->comment_type == 'trackback' ) : ?>
 
<li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
<p><?php _e( 'Pingback:', 'smartline-lite' ); ?> <?php comment_author_link(); ?>
<?php edit_comment_link( __( '(Edit)', 'smartline-lite' ), '<span class="edit-link">', '</span>' ); ?>
</p>
 
<?php else : ?>
 
<li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
 
<div id="div-comment-<?php comment_ID(); ?>" class="comment-body">
 
<div class="comment-author vcard">
<?php echo get_avatar( $comment, 56 ); ?>
<?php printf(__('<span class="fn">%s</span>', 'smartline-lite'), get_comment_author_link()) ?>
</div>
 
<?php if ($comment->comment_approved == '0') : ?>
<p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'smartline-lite' ); ?></p>
<?php endif; ?>
 
<div class="comment-meta commentmetadata">
<a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"><?php printf(__('%1$s at %2$s', 'smartline-lite'), get_comment_date(),  get_comment_time()) ?></a>
<?php edit_comment_link(__('(Edit)', 'smartline-lite'),'  ','') ?>
</div>
 
<div class="comment-content"><?php comment_text(); ?></div>
 
<div class="reply">
<?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
</div>
 
</div>
<?php
endif;
 
 
 
/*==================================== INCLUDE FILES ====================================*/
 
// include Theme Info page
require( get_template_directory() . '/inc/theme-info.php' );
 
// include Theme Customizer Options
require( get_template_directory() . '/inc/customizer/customizer.php' );
require( get_template_directory() . '/inc/customizer/default-options.php' );
 
// include Customization Files
require( get_template_directory() . '/inc/customizer/frontend/custom-layout.php' );
require( get_template_directory() . '/inc/customizer/frontend/custom-slider.php' );
 
// include Template Functions
require( get_template_directory() . '/inc/template-tags.php' );
 
// include Widget Files
require( get_template_directory() . '/inc/widgets/widget-category-posts-boxed.php' );
require( get_template_directory() . '/inc/widgets/widget-category-posts-columns.php' );
require( get_template_directory() . '/inc/widgets/widget-category-posts-grid.php' );
require( get_template_directory() . '/inc/widgets/widget-category-posts-single.php' );
 
// Include Featured Content class in case it does not exist yet (e.g. user has not Jetpack installed)
if ( ! class_exists( 'Featured_Content' ) && 'plugins.php' !== $GLOBALS['pagenow'] ) {
require( get_template_directory() . '/inc/featured-content.php' );
}
 
?>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Não entendi esse título aí, mas beleza.

 

endif está terminando antes do que deveria, ou nem deveria estar terminando.

 

Você não esqueceu de dar include em nada? Ou não colocou no lugar errado?

Compartilhar este post


Link para o post
Compartilhar em outros sites

Título editado. Procure dar títulos condizentes com sua dúvida.

 

 

Sobre o erro, faça o que o Maykel-ctba sugeriu. Esse tipo de erro "Unexpected X" sempre está ligado ao fato de que o compilador/analisador esperava encontrar algum dados, mas não X. Ou seja, seu endif está antes do que deveria. Verifique se há algum if sobrando. Pra todo if deverá haver o endif correspondente.

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.