• i going to develop plugin and i want to access the file the file path is C:\wamp64\www\wordpress\wp-content\plugins\myplugin\applicant_functions
    and the path of file in which this file access is in same folder when i click on active plugin button it sent an error like this
    Parse error: syntax error, unexpected ” ); ?>”> ‘ (T_CONSTANT_ENCAPSED_STRING) in C:\wamp64\www\wordpress\wp-content\plugins\myplugin\applicant_functions\functions.php on line 48

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    So what are lines 40-50 of that file?

    Thread Starter rizwanramzan

    (@rizwanramzan)

    function aasaan_applicant()
    {
      $content = '<div style="border: 0px solid rgb(201, 0, 1); overflow: hidden; margin: 15px auto; max-width: 736px;">
        <a>"></a>
        </div>';
    
    	return $content; 
    }
    add_shortcode('aasaan_applicant','aasaan_applicant');
    Thread Starter rizwanramzan

    (@rizwanramzan)

    * Applicant ID=  */
    function aasaan_applicant()
    {
    	$content = '<div style="border: 0px solid rgb(201, 0, 1); overflow: hidden; margin: 15px auto; max-width: 736px;">
        <a href="<?php echo get_theme_file_uri( '/register/applicant_functions/registration.php' ); ?>"></a>
        </div>';
    
    	return $content; 
    }
    add_shortcode('aasaan_applicant','aasaan_applicant');
     //this is the code of that error
    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    You’re dropping a <?php construct into a string. Break it up and use the string append operator to put things together.

    Something like

    $content = '<div style="border: 0px solid rgb(201, 0, 1); overflow: hidden; margin: 15px auto; max-width: 736px;"><a href="'
       . <?php echo get_theme_file_uri('/register/applicant_functions/registration.php' ); ?> . 
        '"></a></div>';
    Thread Starter rizwanramzan

    (@rizwanramzan)

    Parse error: syntax error, unexpected ‘<‘ in C:\wamp64\www\wordpress\wp-content\plugins\myplugin\applicant_functions\functions.php on line 47

    again send an error

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    What’s line 47?

    Thread Starter rizwanramzan

    (@rizwanramzan)

    function aasaan_applicant()
    {
    	/* $content = '<div style="border: 0px solid rgb(201, 0, 1); overflow: hidden; margin: 15px auto; max-width: 736px;"><a href="'.<?php echo get_theme_file_uri('/applicant_functions/registration.php' ); ?> .'"></a></div>';
    
    	return $content; 
      
    }
    add_shortcode('aasaan_applicant','aasaan_applicant');

    sir I am going to develop a plugin and me directory path is this
    C:\wamp64\www\wordpress\wp-content\plugins\myplugin\applicant_functions
    my files are
    auth_session.php
    login.php
    db.php
    registration.php
    logout.php
    start.php
    dasboard.php

    now i want to access my registration.php file in start.php file kindly tell me how i can access the above code show me the error

    Thread Starter rizwanramzan

    (@rizwanramzan)

    function aasaan_applicant()
    {
    	<strong>the below line is 47</strong>
     $content = '<div style="border: 0px solid rgb(201, 0, 1); overflow: hidden; margin: 15px auto; max-width: 736px;"><a href="'.<?php echo get_theme_file_uri('/applicant_functions/registration.php' ); ?> .'"></a></div>';
    
    	return $content; 
      
    }
    add_shortcode('aasaan_applicant','aasaan_applicant');
    • This reply was modified 3 years, 3 months ago by rizwanramzan.
    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    I think you need to read the developer documentation.

    $content = '<div style="border: 0px solid rgb(201, 0, 1); overflow: hidden; margin: 15px auto; max-width: 736px;"><a href="';
    #content .= get_theme_file_uri('/applicant_functions/registration.php' );
    $content .= '"></a></div>';

    Note that you should not use echo statements inside a shortcode.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘syntax error, unexpected ” ); ?>”> ‘ (T_CONSTANT_ENCAPSED_STRING)’ is closed to new replies.