Parse Error: syntax error del file functions.php
Buona sera, credo di aver messo mano dove non dovevo!
Ho avuto la brillante idea di vedere se potevo aggiungere la funzione di inserire tag all'interno dei miei articoli in modo che quando qualcuno ci clicchi sopra venga rimandato a tutti quei tag (dovevo scrivere una serie di articoli tutti connessi tra di loro, ma non dovevano appartenere ad una determinata categoria quindi stavo pensando di sfruttare gli hashtag, creandone uno per averli tutti, sia sul blog che sui social).
Mi sono imbattuto in una guida dove diceva semplicemente di aggiungere la funzionalità nell'editor del file functions.php.
Ebbene, una volta fatto mi è comparso un errore di sintassi alla linea 279.
Ho prontamente rimosso il codice ma il problema ora persiste! Il problema è che, analizzando l'intero codice con un editor di testo php, le linee totali sono solo 277. Quindi questo errore dov'è?
Purtroppo a livello codice ne capisco ben poco, cercando su internet dovrebbe essere dovuto semplicemente da una mancanza di ";" oppure "\" ma, ripeto, non c'è la linea che mi viene indicata.
Codice PHP:
<?php
/**
* List down the post category
*
* @since supernews 1.0.0
*
* @param int $post_id
* @return string list of category
*
*/
if ( !function_exists('supernews_list_category') ) :
function supernews_list_category( $post_id = 0 ) {
if( 0 == $post_id ){
global $post;
$post_id = $post->ID;
}
$categories = get_the_category($post_id);
$separator = ' ';
$output = '';
if($categories) {
$output .= '<span class="cat-links">';
foreach($categories as $category) {
$output .= '<a href="'.esc_url( get_category_link( $category->term_id ) ).'" rel="category tag">'.esc_html( $category->cat_name ).'</a>'.$separator;
}
$output .='</span>';
echo trim($output, $separator);
}
}
endif;
/**
* Callback functions for comments
*
* @since supernews 1.0.0
*
* @param $comment
* @param $args
* @param $depth
* @return void
*
*/
if ( !function_exists('supernews_commment_list') ) :
function supernews_commment_list($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
extract($args, EXTR_SKIP);
if ('div' == $args['style']) {
$tag = 'div';
$add_below = 'comment';
}
else {
$tag = 'li';
$add_below = 'div-comment';
}
?>
<<?php echo $tag ?>
<?php comment_class(empty($args['has_children']) ? '' : 'parent') ?> id="comment-<?php comment_ID() ?>">
<?php if ('div' != $args['style']) : ?>
<div id="div-comment-<?php comment_ID() ?>" class="comment-body clearfix">
<?php endif; ?>
<div class="comment-author vcard">
<?php if ($args['avatar_size'] != 0) echo get_avatar($comment, '64'); ?>
<?php printf(__('<cite class="fn">%s</cite>', 'supernews' ), get_comment_author_link() ); ?>
</div>
<?php if ($comment->comment_approved == '0') : ?>
<em class="comment-awaiting-moderation"><?php _e('Your comment is awaiting moderation.', 'supernews'); ?></em>
<br/>
<?php endif; ?>
<div class="comment-meta commentmetadata">
<a href="<?php echo esc_url( get_comment_link($comment->comment_ID) ); ?>">
<i class="fa fa-clock-o"></i>
<?php
/* translators: 1: date, 2: time */
printf(__('%1$s at %2$s', 'supernews'), get_comment_date(), get_comment_time()); ?>
</a>
<?php edit_comment_link(__('(Edit)', 'supernews'), ' ', ''); ?>
</div>
<?php comment_text(); ?>
<div class="reply">
<?php comment_reply_link( array_merge($args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
</div>
<?php if ('div' != $args['style']) : ?>
</div>
<?php endif; ?>
<?php
}
endif;
/**
* Date display functions
*
* @since supernews 1.0.0
*
* @param string $format
* @return string
*
*/
if ( ! function_exists( 'supernews_date_display' ) ) :
function supernews_date_display( $format = 'l, F j, Y') {
echo esc_html( date_i18n( $format ,time() ) );
}
endif;