Parse error: syntax error, unexpected 'add_action' (T_STRING)
-
Hi
this is madh, im getting this error on my website URL: https://www.pubcamino.comParse error: syntax error, unexpected ‘add_action’ (T_STRING) in /****/***/-Theme/functions.php on line 1
So please Let me know how to correct it
thanks
madhu
-
given entire code got this error
What’s on line 3 after it has been beautified?
<?php/* * functions and definitions *//* Code Index * * -01- SET UP FUNCTION * -02- NAV MENU ADD HOMEPAGE * -03- COMMENTS FUNCTION * *//* * -01- SET UP FUNCTION */ add_action( ‘after_setup_theme’, ‘cro_setup’ ); if ( ! function_exists( ‘cro_setup’ ) ):function cro_setup() { load_theme_textdomain( ‘localize’, get_template_directory() . ‘/languages’ ); require( get_template_directory() . ‘/inc/custom-functions.php’ ); require( get_template_directory() . ‘/inc/font-list.php’ ); require( get_template_directory() . ‘/inc/sidebar-controller.php’ ); require( get_template_directory() . ‘/inc/widgets/widget-helper.php’ ); require( get_template_directory() . ‘/inc/widgets/carousel.php’ ); require( get_template_directory() . ‘/inc/widgets/twitter.php’ ); require( get_template_directory() . ‘/inc/widgets/video.php’ ); require( get_template_directory() . ‘/inc/widgets/gallery.php’ ); require( get_template_directory() . ‘/inc/widgets/contacts.php’ ); require( get_template_directory() . ‘/inc/widgets/upcommingevents.php’ ); require( get_template_directory() . ‘/inc/widgets/newsletter.php’ ); require( get_template_directory() . ‘/inc/widgets/latestnews.php’ ); require( get_template_directory() . ‘/inc/admin/admin-functions.php’ ); require( get_template_directory() . ‘/inc/meta-boxes/cpt-init.php’ ); require( get_template_directory() . ‘/inc/apps/cal-func.php’ ); require( get_template_directory() . ‘/inc/apps/promo-func.php’ ); require( get_template_directory() . ‘/inc/framework/bookings/book-functions.php’ ); require( get_template_directory() . ‘/inc/framework/header.php’ ); require( get_template_directory() . ‘/inc/framework/menus.php’ ); require( get_template_directory() . ‘/inc/framework/ajax.php’ ); require( get_template_directory() . ‘/inc/framework/footer.php’ ); require( get_template_directory() . ‘/inc/shortcodes/shortcode-functions.php’ ); require( get_template_directory() . ‘/inc/shortcodes/shortcode-team.php’ ); require( get_template_directory() . ‘/inc/shortcodes/shortcode-gallery.php’ ); require( get_template_directory() . ‘/inc/shortcodes/shortcode-calendar.php’ ); require( get_template_directory() . ‘/inc/shortcodes/shortcode-video.php’ ); require( get_template_directory() . ‘/inc/shortcodes/shortcode-menu.php’ ); require( get_template_directory() . ‘/inc/shortcodes/shortcode-layout.php’ ); require( get_template_directory() . ‘/inc/shortcodes/shortcode-contact.php’ ); require( get_template_directory() . ‘/inc/shortcodes/shortcode-promos.php’ ); require( get_template_directory() . ‘/inc/admin/page-controller.php’); require( get_template_directory() . ‘/inc/admin/page-parts.php’); require( get_template_directory() . ‘/inc/admin/admin-helpers.php’); require( get_template_directory() . ‘/inc/admin/formbuilder.php’); require( get_template_directory() . ‘/inc/framework/bookings/book-controller.php’ ); require( get_template_directory() . ‘/inc/framework/bookings/book-parts.php’ ); require( get_template_directory() . ‘/inc/framework/bookings/bookbuilder.php’ ); require( get_template_directory() . ‘/inc/meta-boxes/cpt-functions.php’ ); require( get_template_directory() . ‘/inc/meta-boxes/cpt-builder.php’ ); require( get_template_directory() . ‘/inc/meta-boxes/cpt-tax.php’ ); require( get_template_directory() . ‘/public/style-functions.php’ ); require( get_template_directory() . ‘/public/admin/content.php’ ); require( get_template_directory() . ‘/public/meta-boxes/cpt-init.php’ ); require( get_template_directory() . ‘/public/meta-boxes/content.php’ ); require( get_template_directory() . ‘/public/meta-boxes/content-tax.php’ ); require( get_template_directory() . ‘/public/framework/images.php’ ); require( get_template_directory() . ‘/public/framework/calendar.php’ ); require( get_template_directory() . ‘/public/framework/newsletters.php’ ); require( get_template_directory() . ‘/public/framework/banner.php’ ); require( get_template_directory() . ‘/public/app/bookingform.php’ ); require( get_template_directory() . ‘/public/app/content.php’ ); add_theme_support( ‘automatic-feed-links’ ); add_theme_support(‘custom-background’); add_editor_style(); $cust_args = array( ‘width’ => 2000, ‘height’ => 480 ); add_theme_support( ‘custom-header’, $cust_args); register_nav_menu( ‘primary’, __( ‘Primary Menu’, ‘localize’ ) ); register_nav_menu( ‘secondnav’, __( ‘Primary sub menu’, ‘localize’ ) ); register_nav_menu( ‘topbar’, __( ‘Top Bar Menu’, ‘localize’ ) ); add_theme_support( ‘post-formats’, array( ‘quote’, ‘audio’, ‘video’ ) ); if ( ! isset( $content_width ) ) $content_width = 900; add_theme_support( ‘post-thumbnails’ ); add_image_size( ‘small-feature’, 500, 300 ); add_image_size( ‘carousel1’, 300, 200, true); add_image_size( ‘banner’, 400, 270, true); add_image_size( ‘carsel’, 400, 200, true);}endif; /** * -02- NAV MENU ADD HOMEPAGE */ function cro_page_menu_args( $args ) { $args[‘show_home’] = true; return $args;}add_filter( ‘wp_page_menu_args’, ‘cro_page_menu_args’ );/** * -03- COMMENTS FUNCTION */ if ( ! function_exists( ‘cro_comment’ ) ) :function cro_comment( $comment, $args, $depth ) { $GLOBALS[‘comment’] = $comment; switch ( $comment->comment_type ) : case ‘pingback’ : case ‘trackback’ :?>
<li <?php comment_class(); ?> id=”comment-<?php comment_ID(); ?>”> <p><?php _e( ‘Pingback:’, ‘localize’ ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( ‘(Edit)’, ‘localize’ ), ‘<span class=”edit-link”>’, ‘</span>’ ); ?></p><?phpbreak;default :global $post;?> <li <?php comment_class(); ?> id=”li-comment-<?php comment_ID(); ?>”> <article id=”comment-<?php comment_ID(); ?>” class=”comment”> <header class=”comment-meta comment-author vcard”> <?php echo get_avatar( $comment, 44 ); printf( ‘<cite class=”fn”>%1$s %2$s</cite>’, get_comment_author_link(), ( $comment->user_id === $post->post_author ) ? ‘<span> ‘ . __( ‘Post author’, ‘localize’ ) . ‘</span>’ : ” ); printf( ‘<time datetime=”%2$s”>%3$s</time>‘, esc_url( get_comment_link( $comment->comment_ID ) ), get_comment_time( ‘c’ ), sprintf( __( ‘%1$s at %2$s’, ‘localize’ ), get_comment_date(), get_comment_time() ) ); ?> </header><!– .comment-meta –> <?php if ( ‘0’ == $comment->comment_approved ) : ?> <p class=”comment-awaiting-moderation”><?php _e( ‘Your comment is awaiting moderation.’, ‘localize’ ); ?></p><?php endif; ?><section class=”comment-content comment”><?php comment_text(); ?><?php edit_comment_link( __( ‘Edit’, ‘localize’ ), ‘<p class=”edit-link”>’, ‘</p>’ ); ?></section><!– .comment-content –> <div class=”reply”><?php comment_reply_link( array_merge( $args, array( ‘reply_text’ => __( ‘Reply’, ‘localize’ ), ‘after’ => ”, ‘depth’ => $depth, ‘max_depth’ => $args[‘max_depth’] ) ) ); ?>
</div><!– .reply –> </article><!– #comment-## –><?php break; endswitch; // end comment_type check}endif;add_action( ‘widgets_init’, ‘cro_unregister_widgets’ );function cro_unregister_widgets() { unregister_widget( ‘WP_Widget_Calendar’ ); unregister_widget( ‘WP_Widget_Recent_Posts’ ); unregister_widget( ‘WP_Widget_Recent_Comments’ ); unregister_widget( ‘WP_Widget_Tag_Cloud’ ); unregister_widget( ‘WP_Widget_Archives’ ); unregister_widget( ‘WP_Widget_Links’ ); unregister_widget( ‘WP_Widget_RSS’ );}?>sorry
this on line 3
</div><!– .reply –> </article><!– #comment-## –><?php break; endswitch; // end comment_type check}endif;add_action( ‘widgets_init’, ‘cro_unregister_widgets’ );function cro_unregister_widgets() { unregister_widget( ‘WP_Widget_Calendar’ ); unregister_widget( ‘WP_Widget_Recent_Posts’ ); unregister_widget( ‘WP_Widget_Recent_Comments’ ); unregister_widget( ‘WP_Widget_Tag_Cloud’ ); unregister_widget( ‘WP_Widget_Archives’ ); unregister_widget( ‘WP_Widget_Links’ ); unregister_widget( ‘WP_Widget_RSS’ );}?>
Edit: Okay that’s a lead
what should i need to edit
Replace this:
<?php php
With this:
<?php
i didnt find any <?php php
Ignore what I said about that, my beautifier must have messed up.
So you have this:
<?php/* * functions and definitions */
Replace that with this:
<?php /* * functions and definitions */
ya did it now got this
Parse error: syntax error, unexpected end of file in /home/pubcamin/public_html/wp-content/themes/Bistro-Responsive_Foodie_App-Theme/functions.php on line 3At the end of the file replace this:
:?>
With this:
: ?>
ya i did but same error
Yeah it seems there are many syntax errors in that file. Wait for your theme author to reply.
ok thank you
Replace
<?
to<?php
- The topic ‘Parse error: syntax error, unexpected 'add_action' (T_STRING)’ is closed to new replies.