-
▼
2011
(334)
-
▼
July
(26)
- How to Turn Off RSS Autodiscovery in an Address fo...
- How to Post Flash Files in WordPress
- How to Use My WordPress Big Cartel Plugin
- How to Hide Post Date in WordPress
- How to Get the Most From FeedBurner on Your Wordpr...
- How to Get Rid of Bulk in WordPress
- How to Unpublish a Blog Post in Wordpress
- How to Archive With Thumbnails in WordPress
- How to Create a Blank Splash Page in WordPress
- How to Change 'Leave a Reply' in WordPress
- How to Share an Unpublished Draft in WordPress
- How to Find Auto Save Drafts in Wordpress
- How to Write Code for WordPress Syntax
- How to Insert a Paragraph in WordPress
- How to Add a Graphic to a WordPress Blog Sidebar
- How to Export a Wordpress Feed to Tumblr
- How to Edit a Database Within Wordpress With an Ad...
- How to Set Up a Mirror WordPress Site
- How to Make a WordPress Post Sticky to the Top
- How to Install Multiple Wordpress Plugins Using Fi...
- How to Assign Ratings to Posts in WordPress
- How to Change the Size of the Custom Fields Box in...
- How to Use PHP Within Wordpress Posts
- How to Install Wordpress on Hostgator Using Fantas...
- How to Customize Your WordPress Blog for Beginners
- How to Activate Plugins From API on WordPress
-
▼
July
(26)
adsense
How to Write Code for WordPress Syntax
Write the HTML
1. Write your Web site's HTML first. HTML provides the structure for Web pages, while all other Web languages -- for example, CSS, JavaScript and PHP -- add functionality and style afterwards. Make sure to use the proper doctype declaration for whichever HTML specification you use, whether HTML5 or XHTML.
2. Write well-formed HTML, and even when writing HTML5, close all tags and self-closing tags like '' by adding a space and a backslash, like this: '
'. Enclose your attribute values in single or double quotes. Use the W3C Validator service to check your code.
3. Cut up your HTML file into the following parts: header, body, sidebar and footer. The header begins with your doctype declaration and ends wherever the heading ends, not at the end of the '
' tag itself. The footer ends with your final '
' tag. Save these files as header.php, index.php, sidebar.php and footer.php, respectively.
Write the CSS
4. Write your theme's CSS in the style.css file. While you can include more CSS files in your themes, to minimize the number of server requests, write as much of your CSS in one file as you can.
5. Put each CSS selector on its own line, even when chaining selectors together. The Codex states that you should write each property-value pair on its own line as well, so do not write entire style rules on one line. Here is an example of proper CSS:#something {property: value;property: value;}
6. Write your selectors as single words without spaces or, if necessary, separate words in class names and IDs by using dashes. Do not 'camelcase' class and ID names, such as writing 'authorpage' as 'authorPage.' This is common in JavaScript but poor form in CSS.
Write the PHP
7. Replace HTML code in your PHP files with template tags wherever the page needs to load content written in the WordPress dashboard. Wrap template tags in opening and closing PHP tags as follows:
8. Wherever the template files load images, scripts or any other files that make up the theme, use 'bloginfo()' to make the path relative, as in the following example:
/js/myscript.js'>
9. Create a blank file, and save it as functions.php. Add your custom PHP functions to this file so that you can call them in any of your template files. Write your PHP by using alternating single and double quotes instead of escaping quotes with backslashes. Never write shorthand PHP tags anywhere in your theme. Capitalize any SQL database statements such as 'UPDATE' or 'WHERE ID.' Use proper indentation, and make your code as readable as possible.
1:23 AM | Filed Under | 0 Comments
Comments
Popular Posts
-
1. Log in to your Weebly account. 2. Click 'Theme Editor.' 3. Click on the 'Design' tab. 4. Select 'Edit CSS/HTM...
-
1. Sign up for a publisher account at Bidvertiser. Submit basic contact information and confirm your email address to get started. 2. Lo...
-
1. Log in to your WordPress dashboard. 2. Open the 'Appearance' section on the left side of the WordPress dashboard and then cli...
-
Facebook Widget 1. Create a Facebook fan page for your blog, if you don't already have one. You will have to manually share content wi...
-
1. Open your WordPress Dashboard in your preferred browser. It is accessed at the '/wp-admin' location of your site. For example, ...
-
1. Download and install the WordPress for BlackBerry app via BlackBerry App World. Download the version that corresponds with your BlackBe...
-
1. Go to your WordPress blog's administrative control panel. 2. Click the 'Settings' button on the left-side navigation menu...
-
1. Click the 'Add Contact' button on the 'Add New Post' page. This opens the 'Add a Contact Form' page. 2. Click...
-
1. Register an account with Amazon Web Services Cloud. If you have an existing Amazon account, enter your email address in the appropriate...
-
1. Log into your WordPress.com account using your user name and password. 2. Hover your cursor over the 'My Blogs' tab at the to...
Post a Comment