• I went to add this line of code:to my functions.php file:

    function my_home_category( $query ) {
        if ( $query->is_home() && $query->is_main_query() ) {
            $query->set( 'cat', '1' );
        }
    }
    add_action( 'pre_get_posts', 'my_home_category' );

    and I got the error:

    Parse error: syntax error, unexpected ‘add_action’ (T_STRING), expecting function (T_FUNCTION) in /home1/ikelove/public_html/wp-content/themes/inove/functions.php on line 10

    I then removed the function and wound up going to a clean functions.php file I had saved and pasting the code from there and I’m STILL getting the same error. I even went to a link to the functions.php file for inove 3.0.5 here: https://themes.svn.www.ads-software.com/inove/3.0.5/functions.php to get this code

    [ Moderator note: Code redacted, please use pastebin for posting large amounts of code. ]

    I still get the same damn error. What in the world is going on?

  • The topic ‘How do I fix: Parse error: syntax error, unexpected 'add_action' (T_STRING), ??’ is closed to new replies.