Grow your CSS skills. Land your dream job.

Destroyed by syntax error

  • # September 24, 2012 at 9:18 pm

    What am I missing please

    $cat_post = new WP_Query( array(
    ‘posts_per_page’ => 1,
    ‘category__in’ => array(2))
    ‘post_type’ => array(
    ‘post’,
    ‘custom1′,
    ‘custom2′,
    ‘custom3′
    ),
    );

    # September 24, 2012 at 9:29 pm

    @fectio1 What is the error that it gives (and what line does it say)?

    # September 24, 2012 at 9:31 pm

    syntax error, unexpected T_CONSTANT_ENCAPSED_STRING Line 7 which is between

    # September 24, 2012 at 9:32 pm

    ‘category__in’ => array(2))
    ‘post_type’ => array(

    # September 24, 2012 at 9:35 pm

    @fectio1 Try a comma after (2))?

    # September 24, 2012 at 9:36 pm

    Then I get syntax error, unexpected T_DOUBLE_ARROW on same line.

    # September 24, 2012 at 9:40 pm

    @ChristopherBurton thanks for your suggestions and looking at it. I think it might be that time I need to walk away for a bit.

    # September 24, 2012 at 9:47 pm

    @fectio1 If not a comma then a semi-colon. That would be my only advice.

    # September 24, 2012 at 9:49 pm

    Still throwing an error. Thanks @ChristopherBurton

    # September 24, 2012 at 9:51 pm

    @fectio1 Then try posting on http://stackoverflow.com. I think your code setup is the issue. Post back when they give you the answer.

    # September 24, 2012 at 10:10 pm

    `$cat_post = new WP_Query( array(
    ‘posts_per_page’ => 1,
    ‘category__in’ => array(2),
    ‘post_type’ => array(
    ‘post’,
    ‘custom1′,
    ‘custom2′,
    ‘custom3′
    )
    ));`

    # September 24, 2012 at 10:10 pm

    $cat_post = new WP_Query( array(
    ‘posts_per_page’ => 1,
    ‘category__in’ => array(2),
    ‘post_type’ => array(
    ‘post’,
    ‘custom1′,
    ‘custom2′,
    ‘custom3′
    )
    ));

    # September 24, 2012 at 10:12 pm

    @beeblebrox you are my hero for the next week :)

    # September 24, 2012 at 10:13 pm

    I don’t know why its throwing the end of this onto the next line… but here’s what’s going on:

    ‘category__in’ => array(2), // you had a ) that should have been a ,

    ‘custom3′ ), // this last comma (which I think is on the next line) actually needs to be a )

    # September 24, 2012 at 10:15 pm

    Thank you very much. I have been looking at this for 3 hours, Literally

Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".