Ver Mensaje Individual
  #5 (permalink)  
Antiguo 14/04/2011, 10:49
carlossse
 
Fecha de Ingreso: abril-2011
Mensajes: 5
Antigüedad: 13 años, 7 meses
Puntos: 0
Respuesta: AYUDAA POR FAVOOR Parse error: syntax error, unexpected '}'

Disculpa! no se nada de esto! solo queria editar el tema de wp.
gracias por ayudar...

te envio el codigo nuevamente

el error que dice que hay es en en la linea 257

Parse error: syntax error, unexpected '}' in /home/kittenby/public_html/blog/wp-content/themes/codium-extend/functions.php on line 257


Código PHP:
Ver original
  1. $c[] = 'untagged';
  2.     } else {
  3.         foreach ( (array) get_the_tags() as $tag )
  4.             $c[] = 'tag-' . $tag->slug;
  5.     }
  6.  
  7.     // For password-protected posts
  8.     if ( $post->post_password )
  9.         $c[] = 'protected';
  10.  
  11.     // Applies the time- and date-based classes (below) to post DIV
  12.     codium_extend_date_classes( mysql2date( 'U', $post->post_date ), $c );
  13.  
  14.     // If it's the other to the every, then add 'alt' class
  15.     if ( ++$codium_extend_post_alt % 2 )
  16.         $c[] = 'alt';
  17.  
  18.     // Separates classes with a single space, collates classes for post DIV
  19.     $c = join( ' ', apply_filters( 'post_class', $c ) ); // Available filter: post_class
  20.  
  21.     // And tada!
  22.     return $print ? print($c) : $c;
  23. }
  24.  
  25. // Define the num val for 'alt' classes (in post DIV and comment LI)
  26. $codium_extend_post_alt = 1;
  27. //$codium_extend_comment_alt = 1;
  28.  
  29. // Generates semantic classes for each comment LI element
  30. function codium_extend_comment_class( $print = true ) {
  31.     global $comment, $post, $codium_extend_comment_alt;
  32.  
  33.     // Collects the comment type (comment, trackback),
  34.     $c = array( get_comment_type() );
  35.  
  36.     // Counts trackbacks (t[n]) or comments (c[n])
  37.     if ( $comment->comment_type == 'comment' ) {
  38.         $c[] = "c$codium_extend_comment_alt";
  39.     } else {
  40.         $c[] = "t$codium_extend_comment_alt";
  41.     }
  42.  
  43.     // If the comment author has an id (registered), then print the log in name
  44.     if ( $comment->user_id > 0 ) {
  45.         $user = get_userdata($comment->user_id);
  46.         // For all registered users, 'byuser'; to specificy the registered user, 'commentauthor+[log in name]'
  47.         $c[] = 'byuser comment-author-' . sanitize_title_with_dashes(strtolower( $user->user_login ));
  48.         // For comment authors who are the author of the post
  49.         if ( $comment->user_id === $post->post_author )
  50.             $c[] = 'bypostauthor';
  51.     }
  52.  
  53.     // If it's the other to the every, then add 'alt' class; collects time- and date-based classes
  54.     codium_extend_date_classes( mysql2date( 'U', $comment->comment_date ), $c, 'c-' );
  55.     if ( ++$codium_extend_comment_alt % 2 )
  56.         $c[] = 'alt';
  57.  
  58.     // Separates classes with a single space, collates classes for comment LI
  59.     $c = join( ' ', apply_filters( 'comment_class', $c ) ); // Available filter: comment_class
  60.    
  61.     // Tada again!
  62.     return $print ? print($c) : $c;
  63. }
  64.  
  65. // count comment
  66. function codium_extend_comment_count( $print = true ) {
  67.     global $comment, $post, $codium_extend_comment_alt;
  68.  
  69.     // Counts trackbacks and comments
  70.     if ( $comment->comment_type == 'comment' ) {
  71.         $count[] = "$codium_extend_comment_alt";
  72.     } else {
  73.         $count[] = "$codium_extend_comment_alt";
  74.     }
  75.  
  76.     $count = join( ' ', $count ); // Available filter: comment_class
  77.  
  78.     // Tada again!
  79.     echo $count;
  80.     //return $print ? print($count) : $count;
  81. }
  82.  
  83.  
  84. // Generates time- and date-based classes for BODY, post DIVs, and comment LIs; relative to GMT (UTC)
  85. function codium_extend_date_classes( $t, &$c, $p = '' ) {
  86.     $t = $t + ( get_option('gmt_offset') * 3600 );
  87.     $c[] = $p . 'y' . gmdate( 'Y', $t ); // Year
  88.     $c[] = $p . 'm' . gmdate( 'm', $t ); // Month
  89.     $c[] = $p . 'd' . gmdate( 'd', $t ); // Day
  90.     $c[] = $p . 'h' . gmdate( 'H', $t ); // Hour
  91. }
  92.  
  93. // For category lists on category archives: Returns other categories except the current one (redundant)
  94. function codium_extend_cats_meow($glue) {
  95.     $current_cat = single_cat_title( '', false );
  96.     $separator = "\n";
  97.     $cats = explode( $separator, get_the_category_list($separator) );
  98.     foreach ( $cats as $i => $str ) {
  99.         if ( strstr( $str, ">$current_cat<" ) ) {
  100.             unset($cats[$i]);
  101.             break;
  102.         }
  103.     }
  104.     if ( empty($cats) )
  105.         return false;
  106.  
  107.     return trim(join( $glue, $cats ));
  108. }
  109.  
  110. // For tag lists on tag archives: Returns other tags except the current one (redundant)
  111. function codium_extend_tag_ur_it($glue) {
  112.     $current_tag = single_tag_title( '', '',  false );
  113.     $separator = "\n";
  114.     $tags = explode( $separator, get_the_tag_list( "", "$separator", "" ) );
  115.     foreach ( $tags as $i => $str ) {
  116.         if ( strstr( $str, ">$current_tag<" ) ) {
  117.             unset($tags[$i]);
  118.             break;
  119.         }
  120.     }
  121.     if ( empty($tags) )
  122.         return false;
  123.  
  124.     return trim(join( $glue, $tags ));
  125. }
  126.  
  127. if ( ! function_exists( 'codium_extend_posted_on' ) ) :
  128. // data before post
  129. function codium_extend_posted_on() {
  130.     printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s.', 'codium_extend' ),
  131.         'meta-prep meta-prep-author',
  132.         sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>',
  133.             get_permalink(),
  134.             esc_attr( get_the_time() ),
  135.             get_the_date()
  136.         ),
  137.         sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
  138.             get_author_posts_url( get_the_author_meta( 'ID' ) ),
  139.             sprintf( esc_attr__( 'View all posts by %s', 'codium_extend' ), get_the_author() ),
  140.             get_the_author()
  141.         )
  142.     );
  143. }
  144. endif;
  145.  
  146. if ( ! function_exists( 'codium_extend_posted_in' ) ) :
  147. // data after post
  148. function codium_extend_posted_in() {
  149.     // Retrieves tag list of current post, separated by commas.
  150.     $tag_list = get_the_tag_list( '', ', ' );
  151.     if ( $tag_list ) {
  152.         $posted_in = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'codium_extend' );
  153.     } elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) {
  154.         $posted_in = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'codium_extend' );
  155.     } else {
  156.         $posted_in = __( 'Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'codium_extend' );
  157.     }
  158.     // Prints the string, replacing the placeholders.
  159.     printf(
  160.         $posted_in,
  161.         get_the_category_list( ', ' ),
  162.         $tag_list,
  163.         get_permalink(),
  164.         the_title_attribute( 'echo=0' )
  165.     );
  166. }
  167. endif;
  168.  
  169.  
  170. // Widgets plugin: intializes the plugin after the widgets above have passed snuff
  171. function codium_extend_widgets_init() {
  172.  
  173.         register_sidebar(array(
  174.         'name' => 'SidebarTop',
  175.         'description' => 'Top sidebar',
  176.         'before_widget'  =>   "\n\t\t\t" . '<li id="%1$s" class="widget %2$s"><div class="widgetblock">',
  177.         'after_widget'   =>   "\n\t\t\t</div></li>\n",
  178.         'before_title'   =>   "\n\t\t\t\t". '<div class="widgettitleb"><h3 class="widgettitle">',
  179.         'after_title'    =>   "</h3></div>\n" .''
  180.         ));
  181.        
  182.         register_sidebar(array(
  183.         'name' => 'SidebarBottom',
  184.         'description' => 'Bottom sidebar',
  185.         'before_widget'  =>   "\n\t\t\t" . '<li id="%1$s" class="widget %2$s"><div class="widgetblock">',
  186.         'after_widget'   =>   "\n\t\t\t</div></li>\n",
  187.         'before_title'   =>   "\n\t\t\t\t". '<div class="widgettitleb"><h3 class="widgettitle">',
  188.         'after_title'    =>   "</h3></div>\n" .''
  189.         ));
  190.  
  191.     }
  192.  
  193.  
  194.  
  195. // Changes default [...] in excerpt to a real link
  196. function codium_extend_excerpt_more($more) {
  197.        global $post;
  198.        $readmore = __(' read more <span class="meta-nav">&raquo;</span>', 'codium_extend' );
  199.     return ' <a href="'. get_permalink($post->ID) . '">' . $readmore . '</a>';
  200. }
  201. add_filter('excerpt_more', 'codium_extend_excerpt_more');
  202.  
  203.  
  204. // Runs our code at the end to check that everything needed has loaded
  205. add_action( 'init', 'codium_extend_widgets_init' );
  206.  
  207.  
  208. // Adds filters for the description/meta content in archives.php
  209. add_filter( 'archive_meta', 'wptexturize' );
  210. add_filter( 'archive_meta', 'convert_smilies' );
  211. add_filter( 'archive_meta', 'convert_chars' );
  212. add_filter( 'archive_meta', 'wpautop' );
  213.  
  214. // Remember: the codium_extend is for play.
  215.  
  216.  
  217.  
  218. //Remove <p> in excerpt
  219. function codium_extend_strip_para_tags ($content) {
  220. if ( is_home() && ($paged < 2 )) {
  221.   $content = str_replace( '<p>', '', $content );
  222.   $content = str_replace( '</p>', '', $content );
  223.   return $content;
  224. }
  225. }
  226.  
  227. //Comment function
  228. function codium_extend_comment($comment, $args, $depth) {
  229.    $GLOBALS['comment'] = $comment; ?>
  230.    
  231.    <li id="comment-<?php comment_ID() ?>" class="<?php codium_extend_comment_class() ?>">
  232.       <span class="count"><?php echo codium_extend_comment_count();?></span>
  233.       <div class="comment-author vcard">
  234.         <?php echo get_avatar( $comment, 48 ); ?>
  235.         <?php printf(__('<div class="fn">%s</div> '), get_comment_author_link()) ?>
  236.       </div>
  237.        
  238.       <?php if ($comment->comment_approved == '0') : ?>
  239.          <em><?php _e('Your comment is in moderation.') ?></em>
  240.          <br />
  241.       <?php endif; ?>
  242.  
  243.       <div class="comment-meta"><?php printf(__('%1$s - %2$s <span class="meta-sep">|</span> <a href="%3$s" title="Permalink to this comment">Permalink</a>', 'codium_extend'),
  244.                                         get_comment_date(),
  245.                                         get_comment_time(),
  246.                                         '#comment-' . get_comment_ID() );
  247.                                         edit_comment_link(__('Edit', 'codium_extend'), ' <span class="meta-sep">|</span> <span class="edit-link">', '</span>'); ?></div>
  248.       <div class="clear"></div>
  249.            
  250.       <?php comment_text() ?>
  251.  
  252.       <div class="reply">
  253.          <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
  254.       </div>
  255. <?php
  256.  
  257.         }
  258.        
  259. //custom menu support
  260. add_action( 'init', 'codium_extend_register_my_menu' );
  261.  
  262. function codium_extend_register_my_menu() {
  263.     register_nav_menu( 'primary-menu', __( 'Primary Menu' ) );
  264. }        
  265.  
  266.  
  267. ?>


GRACIAS