• Resolved igloobob

    (@igloobob)


    Hello,

    I’m getting an error message:

    Parse error: syntax error, unexpected 'bathrooms_panel' (T_STRING) in /path/to/site/wp-content/plugins/insert-php/insert_php.php(48) : eval()'d code on line 1

    I am trying to use this to insert php to pull custom fields into variables to use in the tabby tabs plugin.

    This is the code I am trying to use:

    [insert_php]
    $plumbingtitle = get_field('plumbing_panel_title');
    $plumbingpanel = get_field('plumbing_panel');
    $boilerstitle = get_field('boilers_and_heating_panel_title');
    $boilerspanel = get_field('boilers_and_heating_panel');
    $gastitle = get_field('gas_works_panel_title');
    $gaspanel = get_field('gas_works_panel');
    $bathroomstitle = get_field('bathrooms_panel_title);
    $bathroomspanel = get_field('bathrooms_panel'); 
    
    echo do_shortcode('[tabby title="' . $plumbingtitle . '"]');
    
    echo $panelonecontent;
    
    echo do_shortcode('[tabby title="' . $boilerstitle . '"]');
    
    echo $boilerspanel;
    
    echo do_shortcode('[tabby title="' . $gastitle . '"]');
    
    echo $gaspanel;
    
    echo do_shortcode('[tabby title="' . $bathroomstitle . '"]');
    
    echo $bathroomspanel;
    
    echo do_shortcode('[tabbyending]');
    
    [/insert_php]

    Can anyone shed any light on what the issue might be please?

    Thanks!

    https://ww.wp.xz.cn/plugins/insert-php/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator cubecolour

    (@numeeja)

    Hi Jon, me again – I have just installed ‘Insert PHP’ on my test site and it seemed to output the tabs as I expected/hoped.

    It looks like a tiny typo has crept into your code where a closing quote is missing from the line:

    $bathroomstitle = get_field('bathrooms_panel_title);

    I think it should work if you add it in:

    $bathroomstitle = get_field('bathrooms_panel_title');

    Thread Starter igloobob

    (@igloobob)

    Aha!!

    Thanks so much for your follow up here cubecolour. It’s working now 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Parse error: syntax error (T_STRING): eval()'d code’ is closed to new replies.