Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Beginner Help on Code

    I am just starting out, and I have been watching youtuber easydevtut's tutorials on Twitter Bootstrapping Wordpress. I am stuck on his video "Twitter Bootstrap your Theme". I get a parse error on my functions.php, and I do not understand why, especially when I am following his directions step by step. Help!
    Attached Thumbnails Attached Thumbnails Beginner Help on Code-parse-error.jpg  
    Attached Files Attached Files

  • #2
    Senior Coder
    Join Date
    Sep 2010
    Posts
    1,990
    Thanks
    15
    Thanked 233 Times in 233 Posts
    You don't have a closing tag on the script. ?>
    Welcome to http://www.myphotowizard.net

    where you can edit images, make a photo calendar, add text to images, and do much more.


    When you know what you're doing it's called Engineering, when you don't know, it's called Research and Development. And you can always charge more for Research and Development.

  • #3
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I added a closing tag; the parse error still occurs.

  • #4
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Here is an image of the code added with semicolon. Still getting same error though.
    Attached Thumbnails Attached Thumbnails Beginner Help on Code-parse.jpg  

  • #5
    Regular Coder Custard7A's Avatar
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    286
    Thanks
    32
    Thanked 33 Times in 33 Posts
    The bit of code you provided doesn't give the whole picture, but it seems like there should be commas as I've marked below.

    Code:
    
    <?php
    
    
    /**
    * Load CSS and JavaScript
    */
    
    function load_styles_and_scripts(){
    
    	//Load Styles
    	wp_enqueue_style(
    		'bootstrap-styles',
    	 get_template_directory_uri(), '/css/bootstrap.min.css'
    	 );
    	wp_enqueue_style(
    		'main-styles',
    		get_template_directory_uri(), '/style.css');
    	//Load Scripts
    	wp_enqueue_script(
    		'jquery',
    		 'http://code.jquery.com/jquery.min.js');
    	wp_enqueue_script(
    		'bootstrap-scripts', 
    		get_template_directory_uri(), '/js/bootstrap.min.js');
    }
    add_action('wp_enqueue_scripts', 'load_styles_and_scripts');
    
    ?>
    Goodness knows why you've posted a PHP issue under the HTML and CSS section.

  • Users who have thanked Custard7A for this post:

    SoPho (07-20-2013)

  • #6
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thank yyou. Now there are no errors; however, the code was supposed to output a "hello" button instead of an underlined "hello".
    Attached Thumbnails Attached Thumbnails Beginner Help on Code-hello.jpg  
    Attached Files Attached Files

  • #7
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Well your code is an anchor (link) tag, not a button, so there is a link there. However, I suspect what you mean is not a button but rather a link styled as a button. Somewhere you need to put in the CSS styles for the "btn" class.

    I suspect you may find the path to that CSS file through the wp_head() function in your PHP.

    HTH
    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •