Recommended location to set response headers?
There’s a filter for that: function wpse_203745_wp_headers( $headers ) { $headers[‘Expires’] = gmdate( $somedate ) . ‘ GMT’; return $headers; } add_filter( ‘wp_headers’, ‘wpse_203745_wp_headers’ );
There’s a filter for that: function wpse_203745_wp_headers( $headers ) { $headers[‘Expires’] = gmdate( $somedate ) . ‘ GMT’; return $headers; } add_filter( ‘wp_headers’, ‘wpse_203745_wp_headers’ );
The correct hook to use is template_redirect which allows you to have the necessary info available to do checks while also early enough to actually redirect. As per the example on the codex page: function my_page_template_redirect() { if( is_page( ‘goodies’ ) && ! is_user_logged_in() ) { wp_redirect( home_url( ‘/signup/’ ) ); exit(); } } add_action( … Read more
If you have a blog that is hosted on WordPress.com, you can’t install extra plugins or modify the theme files yourself – this is only possible with a self-hosted version. However, WordPress.com has enabled LaTeX support for everyone. Just write $latex your-latex-code$ and it will be rendered as images.
Try putting this snippet in your functions.php <?php function rel_next_prev(){ global $paged; if ( get_previous_posts_link() ) { ?> <link rel=”prev” href=”https://wordpress.stackexchange.com/questions/36800/<?php echo get_pagenum_link( $paged – 1 ); ?>” /><?php } if ( get_next_posts_link() ) { ?> <link rel=”next” href=”<?php echo get_pagenum_link( $paged +1 ); ?>” /><?php } } add_action( ‘wp_head’, ‘rel_next_prev’ ); ?> And if … Read more
The in_admin_header action may be used to insert content before <div id=”wpbody”> in the wordpress backend. See Line 101 of /wp-admin/admin-header.php (line number as of version 3.3.2) Further reading on actions: Action Reference, codex
BODA82’s answer helped, but eventually I realized that I should have replaced responseText with responseJSON method in my JavaScript code. In the example below I was storing the Ajax response results in a variable. I didn’t know there was a specific method to get the response in JSON. In a such way the object/array with … Read more
get_header( $name ) is a WordPress function, that will try to load the file header-{$name}.php from your theme’s root folder. If this file doesn’t exist, WordPress will load the default header.php file.
You should be including wp-load.php, not wp-blog-header.php (which is reserved for use by WordPress only). This is most likely the cause of your problem.
I think the more WordPress friendly way to do this is to use wp_enqueue_styles()‘s $deps parameter. Assuming the plugin styles are enqueued via wp_enqueue_styles() (which, admittedly, pathetically few are), you list an array of the stylesheet handles that your styles depend on and then they load afterwards.
Just add to your theme this code: <?php get_search_form(); ?> This code will echoing search form so place it everywhere where you want to have the search form. Further you need to have search.php file in your theme which will show the search results. You can use ordinary WP loop in the file.