• Resolved oshin99

    (@oshin99)


    hello guys, I am facing debugging error, kindly help me

    parse error: syntax error, unexpected ‘<‘, expecting elseif (T_ELSEIF) or else (T_ELSE) or endif (T_ENDIF) in /home/vol4_8/epizy.com/epiz_26586340/htdocs/wp-content/themes/moderne/single.php on line 26

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi,

    Looks like the IF condition syntax is incorrect in /wp-content/themes/moderne/single.php file that is triggering the error. If you have a backup of the file, try restoring it or fix the IF condition syntax near to the line number 26.

    Thread Starter oshin99

    (@oshin99)

    I don’t know how to…I have no knowledge of programming @emmtoor i am posting the code pls help

    • This reply was modified 3 years, 7 months ago by oshin99.
    Thread Starter oshin99

    (@oshin99)

    
    <?php
    /**
     * The template for displaying all single posts
     *
     * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
     *
     * @package Moderne
     */
    
    $singlelayout = get_theme_mod( 'moderne_single_layout', 'single1' ); 
    get_header(); 
    ?>
    	
    	<?php // single with featured image above title
    	if ( $singlelayout == 'single4')  : ?>
    
    		<div id="primary" class="content-area col-lg-12">
    			<main id="main" class="site-main <?php echo esc_attr($singlelayout); ?>"><?php get_template_part( 'template-parts/post/content', 'single2' ); ?></main>
    		</div>
    		
    	<?php // single no sidebars and featured image below title
    	elseif ( $singlelayout == 'single3')  : ?>
    
    <?php
    			
    		 <div id="primary" class="content-area col-lg-12">
    			<main id="main" class="site-main <?php echo esc_attr($singlelayout); ?>"><?php get_template_part( 'template-parts/post/content', 'single' ); ?></main> 
    		</div>
    		<?php // single left sidebar and featured image below title
    	elseif ( $singlelayout == 'single2')  : ?>
    
    		<div id="primary" class="content-area col-lg-8 order-lg-2">
    			<main id="main" class="site-main <?php echo esc_attr($singlelayout); ?>"><?php get_template_part( 'template-parts/post/content', 'single' ); ?></main>
    		</div>
    		<div class="col-lg-4 order-3 order-lg-1">
    			<?php get_template_part( 'template-parts/sidebars/sidebar', 'left' ); ?>       
    		</div>	
    		
    	<?php // single right sidebar and featured image below title
    	else : ?>
    
    		<div id="primary" class="content-area col-lg-8">
    			<main id="main" class="site-main <?php echo esc_attr($singlelayout); ?>">
    			<?php get_template_part( 'template-parts/post/content', 'single' ); ?></main>
    		</div>
    		
    		<div class="col-lg-4">
    		<?php get_template_part( 'template-parts/sidebars/sidebar', 'right' ); ?>
    		</div>
    		
    	<?php endif; ?>
    
    <?php
    get_footer();
    
    • This reply was modified 3 years, 7 months ago by Yui.

    I see that <?php tag on line 24 is not required. Try replacing the code with the following:

    <?php
    /**
    * The template for displaying all single posts
    *
    * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
    *
    * @package Moderne
    */
    
    $singlelayout = get_theme_mod( ‘moderne_single_layout’, ‘single1’ );
    get_header();
    ?>
    
    <?php // single with featured image above title
    if ( $singlelayout == ‘single4’) : ?>
    
    <div id=”primary” class=”content-area col-lg-12″>
    <main id=”main” class=”site-main <?php echo esc_attr($singlelayout); ?>”><?php get_template_part( ‘template-parts/post/content’, ‘single2’ ); ?></main>
    </div>
    
    <?php // single no sidebars and featured image below title
    elseif ( $singlelayout == ‘single3’) : ?>
    
    <div id=”primary” class=”content-area col-lg-12″>
    <main id=”main” class=”site-main <?php echo esc_attr($singlelayout); ?>”><?php get_template_part( ‘template-parts/post/content’, ‘single’ ); ?></main>
    </div>
    <?php // single left sidebar and featured image below title
    elseif ( $singlelayout == ‘single2’) : ?>
    
    <div id=”primary” class=”content-area col-lg-8 order-lg-2″>
    <main id=”main” class=”site-main <?php echo esc_attr($singlelayout); ?>”><?php get_template_part( ‘template-parts/post/content’, ‘single’ ); ?></main>
    </div>
    <div class=”col-lg-4 order-3 order-lg-1″>
    <?php get_template_part( ‘template-parts/sidebars/sidebar’, ‘left’ ); ?>
    </div>
    
    <?php // single right sidebar and featured image below title
    else : ?>
    
    <div id=”primary” class=”content-area col-lg-8″>
    <main id=”main” class=”site-main <?php echo esc_attr($singlelayout); ?>”>
    <?php get_template_part( ‘template-parts/post/content’, ‘single’ ); ?></main>
    </div>
    
    <div class=”col-lg-4″>
    <?php get_template_part( ‘template-parts/sidebars/sidebar’, ‘right’ ); ?>
    </div>
    
    <?php endif; ?>
    
    <?php
    get_footer();
    Thread Starter oshin99

    (@oshin99)

    omg! That’s such a trivial blunder. Thanks a lot. its been solved @emmtoor

    You’re welcome 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘debug eroor’ is closed to new replies.