Foros del Web » Programando para Internet » PHP »

Parse error: syntax error, unexpected '<' en mi Template

Estas en el tema de Parse error: syntax error, unexpected '<' en mi Template en el foro de PHP en Foros del Web. Hola gente como andan, No tengo idea sobre el lenguage php. Me salto un error en functions.php de mi template Parse error: syntax error, unexpected ...
  #1 (permalink)  
Antiguo 23/06/2012, 17:10
 
Fecha de Ingreso: diciembre-2011
Mensajes: 12
Antigüedad: 12 años, 3 meses
Puntos: 0
Información Parse error: syntax error, unexpected '<' en mi Template

Hola gente como andan,

No tengo idea sobre el lenguage php.

Me salto un error en functions.php de mi template

Parse error: syntax error, unexpected '<' in /home1/juancocc/public_html/wp-content/themes/ColormaticTheme/functions.php on line 139

Este es el la parte donde estaría el error

<?php
}
function dtw_pings($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
?>
<li <?php comment_class('pingback'); ?> id="comment-<?php comment_ID() ?>">
<div id="comment-div-<?php comment_ID() ?>" class="comment-container-div">
<p><?php comment_author_link(); ?> - <?php comment_date('jS M, y h:ma') ?></p>
</div>
function dtw_feed($url) {
if(dtw_check_option('feedburner_url')) {
$url = get_option('dtw_feedburner_url');

return $url;
}
add_filter('feed_link', 'dtw_feed');

function dtw_header() {
if(dtw_check_option('header_tracking')) {
echo get_option('dtw_header_tracking') . "\n";
}


Gracias
Saludos
  #2 (permalink)  
Antiguo 23/06/2012, 17:21
Avatar de jamie_88  
Fecha de Ingreso: abril-2011
Ubicación: Lima
Mensajes: 161
Antigüedad: 12 años, 11 meses
Puntos: 28
Respuesta: Parse error: syntax error, unexpected '<' en mi Template

no se cual es la linea 139

pero segun lo que has puesto no has abierto el php en:

<?php function dtw_feed($url) {
  #3 (permalink)  
Antiguo 23/06/2012, 17:35
 
Fecha de Ingreso: diciembre-2011
Mensajes: 12
Antigüedad: 12 años, 3 meses
Puntos: 0
Respuesta: Parse error: syntax error, unexpected '<' en mi Template

Hola jamie_88,

Abri el php como me pusiste ahi pero me sigue dando error.

Como puedo saber cual es la linea 139?

Gracias
  #4 (permalink)  
Antiguo 23/06/2012, 17:54
Avatar de rodrigo791  
Fecha de Ingreso: noviembre-2009
Ubicación: Uruguay
Mensajes: 1.339
Antigüedad: 14 años, 4 meses
Puntos: 168
Respuesta: Parse error: syntax error, unexpected '<' en mi Template

Como puedo saber cual es la linea 139?
Con un block de notas...
  #5 (permalink)  
Antiguo 23/06/2012, 18:02
 
Fecha de Ingreso: diciembre-2011
Mensajes: 12
Antigüedad: 12 años, 3 meses
Puntos: 0
Respuesta: Parse error: syntax error, unexpected '<' en mi Template

No me doy cuenta donde tengo el error

function dtw_footer() {
if(dtw_check_option('footer_tracking')) { LINEA 139
echo get_option('dtw_footer_tracking') . "\n";
}
}
add_action('wp_footer', 'dtw_footer');

include 'widgets/twitter.php';
include 'widgets/flickr.php';
include 'widgets/recent_blog_posts.php';
include 'widgets/popular_blog_posts.php';
include 'widgets/blog_navigator.php';
include 'widgets/sponsors.php';
include 'widgets/my_social_networks.php';
include 'widgets/about_me.php';
include 'widgets/subscribe.php';

Gracias
  #6 (permalink)  
Antiguo 23/06/2012, 18:19
Avatar de rodrigo791  
Fecha de Ingreso: noviembre-2009
Ubicación: Uruguay
Mensajes: 1.339
Antigüedad: 14 años, 4 meses
Puntos: 168
Respuesta: Parse error: syntax error, unexpected '<' en mi Template

Bueno ni idea, puede que el error lo tengas en alguna función que estes llamando desde otro archivo.
  #7 (permalink)  
Antiguo 23/06/2012, 18:22
 
Fecha de Ingreso: diciembre-2011
Mensajes: 12
Antigüedad: 12 años, 3 meses
Puntos: 0
Respuesta: Parse error: syntax error, unexpected '<' en mi Template

Gracias de todas maneras Rodrigo
  #8 (permalink)  
Antiguo 23/06/2012, 18:22
Avatar de jamie_88  
Fecha de Ingreso: abril-2011
Ubicación: Lima
Mensajes: 161
Antigüedad: 12 años, 11 meses
Puntos: 28
Respuesta: Parse error: syntax error, unexpected '<' en mi Template

este codigo es distinto a lo que has puesto antes...


pon desde la linea 135 hasta la 140 (completas) para poder ver el error...

hay veces que te da error en la linea "139" pero quisas te olvidaste un ";" en la linea "138"...
  #9 (permalink)  
Antiguo 23/06/2012, 19:48
 
Fecha de Ingreso: diciembre-2011
Mensajes: 12
Antigüedad: 12 años, 3 meses
Puntos: 0
Respuesta: Parse error: syntax error, unexpected '<' en mi Template

Pasos las lineas del 135 al 140



add_action('wp_head', 'dtw_header');

} ?>


function dtw_footer() {
  #10 (permalink)  
Antiguo 23/06/2012, 19:59
 
Fecha de Ingreso: diciembre-2011
Mensajes: 12
Antigüedad: 12 años, 3 meses
Puntos: 0
Respuesta: Parse error: syntax error, unexpected '<' en mi Template

De todas maneras les voy a dejar todo el functions php.

<?php
include_once 'dtw_cp/dtw_control_panel.php';
include_once 'functions/meta_boxes.php';

// Register Widgets to Sidebar
if (function_exists('register_sidebar')) {
register_sidebar(
array(
'name' => 'Sidebar Right',
'before_widget' => '<li id="%1$s" class="widget %2$s content-box widget_class">',
'after_widget' => '<div class="clear"></div></div></li>',
'before_title' => '<h3 class="headline">',
'after_title' => '</h3><div class="widget-wrapper">',
)
);
register_sidebar(
array(
'name' => 'Sidebar Left',
'before_widget' => '<li id="%1$s" class="widget %2$s content-box">',
'after_widget' => '<div class="clear"></div></div></li>',
'before_title' => '<h3 class="headline">',
'after_title' => '</h3><div class="widget-wrapper">',
)
);

register_sidebar(
array(
'name' => 'Footer',
'before_widget' => '<li id="%1$s" class="widget %2$s content-box">',
'after_widget' => '<div class="clear"></div></div></li>',
'before_title' => '<h3 class="headline">',
'after_title' => '</h3><div class="widget-wrapper">',
)
);
}

add_filter('dynamic_sidebar_params', 'widgets_classes');
function widgets_classes($params) {
global $widget_num;

if($params[0]['name'] == 'Sidebar Right') {
// Widget class
$class = array();

// Iterated class
$widget_num++;
if($widget_num == 4) {
$widget_num = 1;
}

$class[] = 'widget-' . $widget_num;
// Join the classes in the array
$class = join(' ', $class);

// Interpolate the 'my_widget_class' placeholder
$params[0]['before_widget'] = str_replace('widget_class', $class, $params[0]['before_widget']);
}

return $params;
}
function redirect_to_post(){
global $wp_query;
if( is_archive() && $wp_query->post_count == 1 ){
the_post();
$post_url = get_permalink();
wp_redirect( $post_url );
}
}

add_action('template_redirect', 'redirect_to_post');
function dtw_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
?>
<?php
if($comment->comment_author_email == get_the_author_email()) {
$post_author = ' (author comment)';
}
else {
$post_author = '';
$comment_class = 'normal';
}
?>
<li <?php comment_class($comment_class); ?> id="comment-<?php comment_ID() ?>">
<div id="comment-div-<?php comment_ID() ?>" class="comment-container-div">
<div class="author-info">
<?php echo get_avatar($comment, 38); ?>
<div class="text-info">
<p class="author_name"><?php comment_author_link(); ?><?php echo $post_author; ?></p>
<p class="comment_date">- <?php comment_date('jS M, y h:ma') ?> <?php edit_comment_link(); ?></p>
<div class="clear"></div>
</div>
</div>
<div class="clear"></div>
add_theme_support( ‘nav-menus’ );
<div class="comment-entry">
<?php if ($comment->comment_approved == '0') : ?>
<strong style="display: block; padding-bottom: 5px;">Your comment is awaiting moderation.</strong>
<?php endif; ?>
<div class="actual-comment">
<?php comment_text() ?>
<p><?php comment_reply_link(array_merge($args, array('reply_text' => 'Reply to this comment', 'add_below' => NULL, 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?></p>
</div>
</div>
</div>
<?php
}
function dtw_pings($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
?>
<li <?php comment_class('pingback'); ?> id="comment-<?php comment_ID() ?>">
<div id="comment-div-<?php comment_ID() ?>" class="comment-container-div">
<p><?php comment_author_link(); ?> - <?php comment_date('jS M, y h:ma') ?></p>
</div>

<?php
}
function dtw_feed($url) {
if(dtw_check_option('feedburner_url')) {
$url = get_option('dtw_feedburner_url');
return $url;
}
add_filter('feed_link', 'dtw_feed');

function dtw_header() {
if(dtw_check_option('header_tracking')) {
echo get_option('dtw_header_tracking') . "\n";
}
if(dtw_check_option('meta_description')) {
echo '<meta name="description" content="' . get_option('dtw_meta_description') . '" />' . "\n";
}
if(is_archive() && dtw_check_option('index_archives')) {
echo '<meta name="robots" content="noindex, nofollow" />' . "\n";
}
}
add_action('wp_head', 'dtw_header');

} ?>


function dtw_footer() {
if(dtw_check_option('footer_tracking')) {
echo get_option('dtw_footer_tracking') . "\n";
}
}
add_action('wp_footer', 'dtw_footer');

include 'widgets/twitter.php';
include 'widgets/flickr.php';
include 'widgets/recent_blog_posts.php';
include 'widgets/popular_blog_posts.php';
include 'widgets/blog_navigator.php';
include 'widgets/sponsors.php';
include 'widgets/my_social_networks.php';
include 'widgets/about_me.php';
include 'widgets/subscribe.php';
include 'widgets/premium_sponsor.php';

Espero me pueda ayudar

Gracias
  #11 (permalink)  
Antiguo 23/06/2012, 21:51
Avatar de rodrigo791  
Fecha de Ingreso: noviembre-2009
Ubicación: Uruguay
Mensajes: 1.339
Antigüedad: 14 años, 4 meses
Puntos: 168
Respuesta: Parse error: syntax error, unexpected '<' en mi Template

me parece que tu error no lo tenes ahi sino en los archivos a los que llamas

Etiquetas: html, parse, syntax, template, unexpected
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 19:29.