-
▼
2013
(302)
-
▼
October
(22)
- How to Add Amazon Context Links to Wordpress
- How to Export WordPress eCommerce Products to a Ne...
- How to Convert From Cutenews to Wordpress
- How to Edit the Registration Form in WordPress
- How to Sync Wordpress With Facebook Profiles
- How to Insert a Tagline in WordPress
- How to Automatically Link Wordpress Posts to Facebook
- How to Use Script With WordPress
- How to Embed Google AdSense in WordPress With a Wi...
- How to Embed a Poll in a WordPress Blog
- How to Convert WordPress MU to WordPress
- How to Upload WordPress Theme 2.9
- How to Enable OpenID Server in a WordPress Blog
- How to Install and Activate Thesis Wordpress Theme
- How to Remove WordPress Break Tags
- How to Use WordPress as a Facebook CMS
- How to Rotate Images in a WordPress Blog
- How to Insert NextGEN Gallery in WordPress
- How to Display Hebrew in WordPress
- How to Create a Custom WordPress Page Template Fro...
- How to Place Ads on WordPress
- How to Make a Scroll Box in a WordPress Post
-
▼
October
(22)
adsense
How to Use Script With WordPress
PHP Scripts
1. Go to your WordPress theme folder and open the 'functions.php' file on Notepad. If the theme does not have one, create a new file named 'functions.php.'
2. Type in your PHP script. For example:function myscript() {return 'WordPress rocks!';}
3. Define the shortcode to use when using the script on your WordPress blog. Add the following after your PHP script:add_shortcode('wprocks', 'myscript');Replace 'wprocks' with the name you wish to have for your shortcode and 'myscript' with the name of your PHP function.
4. Save your file and upload it to your website.
5. Log in to your WordPress site.
6. Go to 'Posts' and click on 'Add New.'
7. Switch to the 'HTML' tab and type in the shortcode:[wprocks]
8. Save the post. View it to see your script in action.
JavaScript
9. Open Notepad, paste your JavaScript code and save the file as a JS file. For example, type 'myjavascript.js.'
10. Log in to WordPress. Click 'Media' and 'Add New,' and select your JavaScript file to upload.
11. Copy the URL displayed in the 'File URL' field.
12. Go to 'Posts' and 'Add New.' Switch to the 'HTML' tab.
13. Type in the following code to load your JavaScript file:
Replace 'myjavascript.js' with the URL codeType in the code to call your JavaScript function. For example:
Save your post and view your page.
3:48 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