If Modified Since HTTP Header

the_modified_date() is a template tag that must used inside the loop, that is why it is not wokring for you. WordPress provide a action and filter hook to include or modify HTTP headers: send_headers action wp_headers filter But it doesn’t work for this purpose. For example, the next code is not working: add_action( ‘send_headers’, ‘cyb_add_last_modified_header’ … Read more

Setting Last Modified HTTP Header on static Home Page

Last-Modified header for visitors on the front-page It’s useful to see how the Last-Modified header is added to the feeds, in the wp::send_header() method. If we want to be able to use is_front_page(), then the filters wp_headers or send_header are probably applied to early. We could instead use the template_redirect hook to target the front-page, … Read more

Putting content into header.php without using wp_head

Removing wp_head will have some negative effects as it won’t allow you to use virtually 90% of the plugins on wordpress.org. Also some of that code you are seeing only shows up when you are logged in (unless your theme is specifically adding it). For example, the dashicons, open sans, and admin-bar stylesheets and inline … Read more

Getting “Cannot modify header information – headers already sent” error on wp-admin only whenever any plugin is activated

Error Diagnosis: The first Error: PHP Warning: An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href=”https://wordpress.org/support/”>support forums</a>. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /Applications/MAMP/htdocs/site-url.com/wp-includes/update.php on line 306 This is basically … Read more

Custom endpoint and X-WP-TotalPages (headers)

I had a quick look and here’s how the headers are set in the WP_REST_Posts_Controller::get_items() method: $response = rest_ensure_response( $posts ); // … $response->header( ‘X-WP-Total’, (int) $total_posts ); $response->header( ‘X-WP-TotalPages’, (int) $max_pages ); // … return $response; where: $total_posts = $posts_query->found_posts; and we could use as @jshwlkr suggested: $max_pages = $posts_query->max_num_pages; You could emulate that … Read more

Is it safe to fix Access-Control-Allow-Origin (CORS origin) errors with a php header directive?

Yes, you open your site to being requested via AJAX to any other script in the whole web. It would be better if you limit the origin to one specific remote domain from which you are consuming the API, like this example: header(“Access-Control-Allow-Origin: http://mozilla.com”); However as the mozilla documentation states, a client can fork the … Read more

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’ );

Disable h1 and h2 from rich text editor combobox

you can change lots of things about the tinyMCE editor at the tiny_mce_before_init filter. http://codex.wordpress.org/TinyMCE_Custom_Buttons the following will restrict your blockformats to p,h3,h4 and blockquote function wpa_45815($arr){ $arr[‘theme_advanced_blockformats’] = ‘p,h3,h4,blockquote’; return $arr; } add_filter(‘tiny_mce_before_init’, ‘wpa_45815’); EDIT for WordPress 3.9 see link function wpa_45815($arr){ $arr[‘block_formats’] = ‘Paragraph=p;Heading 3=h3;Heading 4=h4’; return $arr; } add_filter(‘tiny_mce_before_init’, ‘wpa_45815’);

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