Data validation for inline javascript

You can use addslashes() and stripslashes() to prepare any data for database entry. These are native PHP functions, not wordpress functions, so they do not necessarily need to be hooked anywhere specific in the wordpress load to work.

Post Attachment missing head (stylesheets/js/what-not)

A good place to start is with the template hierarchy flow chart. http://codex.wordpress.org/images/1/18/Template_Hierarchy.png I’m always consulting this page. When you say modified twenty eleven, what do you mean? The image.php file is what handles image attachment pages in twenty eleven. I’m not familiar entirely with how it works, but it may be also making a … Read more

Background of default template showing instead of the background of custom page template

As I suspected, the issue is where/how you’re outputting your custom stylesheet. First, move this to functions.php: function mypage_head() { echo ‘<link rel=”stylesheet” type=”text/css” href=”‘.get_bloginfo(‘template_directory’).’/OldSkool-src/style.css”>’.”\n”; } add_action(‘wp_head’, ‘mypage_head’); Second, change the action into which you’re hooking your callback. You’re using wp_head. All other stylesheets will be using wp_print_styles. The wp_print_styles action fires inside of the … Read more

Echo a div to header.php from functions.php

The wp_head() template tag is intended to fire in the HTML document head, rather than the page header, and is used to output script and stylesheet links and tags, and other similar things in the HTML document head. It should appear immediately before the closing HTML </head> tag, like so: <?php wp_head(); ?> </head> If … Read more

output specific location in the header

Okay, here is a working example of what you (might) want to do. Put the following in your functions.php: add_action(‘wp_head’, ‘my_jquery_code’, 999999999); function my_jquery_code() { $jquery_code = <<<JQUERY <script> // jQuery code goes here… </script> JQUERY; echo $jquery_code.PHP_EOL; } // function my_jquery_code

Unable to apply selective loading

Try this. It dequeues the style and script set in ‘init’. add_action( ‘template_redirect’, ‘remove_wizzylike’ ); function remove_wizzylike() { if ( ! is_single() ) add_action( ‘wp_head’, ‘remove_wizy’, 5 ); } function remove_wizy() { remove_action( ‘wp_head’, ‘wizylike_head’ ); // Enqueued in wizylike_init() wp_dequeue_style( ‘wizylike’ ); wp_dequeue_script( ‘wizylike’ ); }

Removing action from template class

include TEMPLATEPATH.”/inc/settings.php”; is your problem. TEMPLATEPATH is used by the parent theme For child themes use STYLESHEETPATH so your code will be include STYLESHEETPATH.”/inc/settings.php”; Alternatively you can use get_stylesheet_directory_uri().’/inc/settings.php’

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)