• Hi – we really are not understanding a parse error message we are getting.

    We used the plugin code to create a table of contents on this page https://ireadlabelsforyou.com/baby-products/. But it throws an error. (I pasted the code and the error message at the end of this message).

    The plugin works fine in a different page – https://ireadlabelsforyou.com/products-i-like/.
    GOOD CODE HERE
    [insert_php]
    $args = array(
    ‘show_option_all’ => ”,
    ‘orderby’ => ‘name’,
    ‘order’ => ‘ASC’,
    ‘style’ => ‘list’,
    ‘show_count’ => 0,
    ‘hide_empty’ => 1,
    ‘use_desc_for_title’ => 1,
    ‘child_of’ => 75,
    ‘feed’ => ”,
    ‘feed_type’ => ”,
    ‘feed_image’ => ”,
    ‘exclude’ => ”,
    ‘exclude_tree’ => ”,
    ‘include’ => ”,
    ‘hierarchical’ => 1,
    ‘title_li’ => __( ‘Browse a Category Below:’ ),
    ‘show_option_none’ => __( ” ),
    ‘number’ => null,
    ‘echo’ => 1,
    ‘depth’ => 0,
    ‘current_category’ => 0,
    ‘pad_counts’ => 0,
    ‘taxonomy’ => ‘category’,
    ‘walker’ => null
    );
    wp_list_categories( $args );
    [/insert_php]

    We have reviewed your instructions regarding error messages but just can’t seem to figure out what is wrong. (We are not using visual composer).

    Can you look at the code below and the error message to determine what we are doing wrond?

    CODE THROWING AN ERROR HERE
    [insert_php]
    $args = array(
    ‘show_option_all’ => ”,
    ‘orderby’ => ‘name’,
    ‘order’ => ‘ASC’,
    ‘style’ => ‘list’,
    ‘show_count’ => 0,
    ‘hide_empty’ => 1,
    ‘use_desc_for_title’ => 1,
    ‘child_of’ => 124,
    ‘feed’ => ”,
    ‘feed_type’ => ”,
    ‘feed_image’ => ”,
    ‘exclude’ => ”,
    ‘exclude_tree’ => ”,
    ‘include’ => ”,
    ‘hierarchical’ => 1,
    ‘title_li’ => __( ‘Browse a Category Below:’ ),
    ‘show_option_none’ => __( ” ),
    ‘number’ => null,
    ‘echo’ => 1,
    ‘depth’ => 0,
    ‘current_category’ => 0,
    ‘pad_counts’ => 0,
    ‘taxonomy’ => ‘category’,
    ‘walker’ => null
    );
    wp_list_categories( $args );
    [/insert_php]


    Error Message:

    Parse error: syntax error, unexpected ‘=’, expecting ‘)’ in /home/irinawebb1/public_html/wp-content/plugins/insert-php/insert_php.php(48) : eval()’d code on line 3

    What is it that we are not seeing?

    Thank you for your assistance,

    Meagan

Viewing 1 replies (of 1 total)
  • Plugin Author WillBontrager

    (@willbontrager)

    The only difference I see in the two array declarations is the value of the ‘child_of’ key.

    If the same code works on one page and not on another, then there is a difference somewhere else.

    Verify you’re using the Text tab and not the Visual on the editing page when pasting in the PHP code.

    If you’re using a plugin that may manipulate the page content, like Visual Composer (as an example), then it may be converting > into its HTML entity equivalent.

    Have a look at what WordPress is storing in the MySQL wp_posts table to see what Insert PHP is working with. It may provide a clue.

    Will

Viewing 1 replies (of 1 total)
  • The topic ‘Parse error message – cannot figure out error in code’ is closed to new replies.