Add Scripts to WP Header.php with Functions.php

Sometimes we need to add references to scripts, metatags or conditional styles to the WordPress <head></head> section in header.php. WordPress has an action hook for this purpose. It's very easy to use. To add scripts, conditional styles or links to header.php, use the wp_head() action hook, like this: add_action('wp_head', 'function_name'); function function_name() { echo "\n"; /* New line */ /* function content */ echo "\n"; /* New line */ } For example, IE9 struggles with CSS gradients so if you use ColorZilla to create a CSS gradient you will need to add a … [Read more...]

HowTo: Add New Widgets to Genesis Child Themes

Easier to do than adding a new custom menu to a Genesis child theme. Just a few lines of code in the child theme's functions.php file is all you need to add a new widget area anywhere within your WordPress site. Genesis uses 'hooks' to make it easy to latch code into the theme. A full list of Genesis hooks is available here. To add a new widget to a theme, we need to name the widget, tell WordPress the widget exists and tell Genesis where to put it. To show you how to  do this, I'll show you a block of code to add a widget then I'll show you how the code works. Look at this code … [Read more...]

Using PHP to Send Data Between Webpages

php

Every now and again we web designers need to pass user input between pages. It could be a username or affiliate code that needs adding into a set of links; it could be details of a contact form that need passing over to a confirmation page before being sent to a database or email server; or it could be any other bit of information that a site visitor enters into one form that must be reproduced or used somewhere within another page or set of pages. Luckily, for those of us who haven't studied PHP, the recipe for passing information between pages contains few ingredients and is easy to follow … [Read more...]

All original content on these pages is fingerprinted and certified by Digiprove
Loading

Invite Friends to ‘JournalXtra’

Supercharge your web design skills with JournalXtra

Buy me lunch!

I'm a cheap date. Where else can you buy lunch for a couple of dollars?

I accept Bitcoin too!

Categories

Dynamik Website Builder
WPMU DEV - The WordPress Experts
StudioPress Theme of the Month