Show an image in my header.php

WordPress contains built-in support to select header images for a theme. You only have to indicate that your theme supports this, by calling add_custom_image_header(). See the Twenty Ten initialization for details. In your theme’s header.php you then call header_image() to get the current header image.

Changing the title tag from a shortcode

You are correct in your thinking that because the loop evaluates after the header you will not be able to get the contents of the loop there. The easiest way to do this is probably with jQuery. Something like this: <script type=”text/javascript”> $(document).ready(function() { document.title=”blah”; }); </script> Place this code in your loop, and the … Read more

What is the “proper” way to generate a javascript variable depending on a custom field value?

You may wish to look at this question. In that question, the admin-ajax url is passed through, but it can be any variable (or array of variables), like for instance $nameAttribute. For instance, you would call wp_localize_script(‘my_js_file_handle’,’my_js_object’,array(‘attribute’=>$nameAttribute))` then in your js file, the variable would be accessible from my_js_object.attribute. (You must enqueue the javascript file … Read more

Where should I hook into admin?

Not sure about the Membership plug-in bit, but admin_init will be your best bet. I assume that you don’t actually what to hook into the admin header though – this would be admin_head or admin_head-(plugin_page) – but you cannot redirect after these hooks (headers already sent).

Banner in WordPress

What about <?php if ( is_home() ) { ?><div id=”banner”>my content</div><?php } else { ?><div id=”banner”>not-home banner/div><?php } ?>

Get search.php results in header.php?

Now, is it possible to check if page is the search page is_search() AND what’s the search string is_search() AND print get_query_var( ‘s’ ) AND how many posts were found? is_search() AND print $GLOBALS[‘wp_query’]->number_posts() … or if you got a custom query… $my_query = new WP_Query( array( /* whatever args */ ) ); is_search() AND … Read more

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