Auto-refresh page every minute?

you can add <meta http-equiv=”refresh” content=”60″> to your header.php file in wordpress theme. EDIT: I removed the last bit of code and just made a plugin with read me file and the functions you would want. You can download the plugin from here WP Auto Refresh Plugin and install it from the beck-end. Note i … Read more

Why I can’t add a script-code into theme-settings without 403-forbidden?

Solution: Because the theme JavaScript is not in: /js/sticky-menu.js Rather, it’s in your theme folder (as your theme name is lifestyle-pro, as found from your site’s HTML): /wp-content/themes/lifestyle-pro/js/sticky-menu.js So your <script> CODE should be: <script data-cfasync=”false” src=”https://wordpress.stackexchange.com/wp-content/themes/lifestyle-pro/js/sticky-menu.js”></script> Bonus: This can be made better with the use of the WordPress function get_stylesheet_directory_uri(). In that case, your … Read more

Different custom header image on different page

create new file in your theme with name header-custom.php next copy this code into that file class customheaderMetabox { private $screen = array( ‘post’, ‘page’, ); private $meta_fields = array( array( ‘label’ => ‘Add Image Header’, ‘id’ => ‘addimageheader_24744’, ‘type’ => ‘media’, ), ); public function __construct() { add_action( ‘add_meta_boxes’, array( $this, ‘add_meta_boxes’ ) ); … Read more

Change the headers content type with wp_remote_post

So, you set the headers of a request using wp_remote_post() and you expect that headers be used in the response. That is what I understand from you: When I print the response content-type is still “text/html” I think that you are missunderstanding the HTTP headers. Using wp_remote_post() you make a request and you can set … Read more

Indenting (tabbing) WP_head

Technically possibly, but probably not worth the effort (and overhead). If you inspect the source with something like Developer Tools in Chrome, your HTML will be automatically indented. In fact, some caching plugins (like W3 Total Cache) even remove all whitespace to improve page load times. That said, if you want to ensure that your … Read more

How do you log a user out with wp_logout?

If you’re using wp_logout in your own code, its probably best to exit or wp_redirect immediately afterwards. You can call wp_set_current_user(0) after wp_logout() to manually log the user out instantly, if you need to continue executing PHP but don’t want the user to be logged in.

Getting redirect to happen before header output

Your method is called too late. I don’t know how you call this method but you need to run it before output is sent to the browser– usually that means before get_header(). There are a number of hooks that can be used. For example (from https://wordpress.stackexchange.com/a/131210/21376): add_action( ‘template_redirect’, function() { if (is_single()) { wp_safe_redirect(home_url()); exit; … Read more

Remove rel=shortlink from HTTP header

<?php add_filter(‘after_setup_theme’, ‘remove_redundant_shortlink’); function remove_redundant_shortlink() { // remove HTML meta tag // <link rel=”shortlink” href=”http://example.com/?p=25″ /> remove_action(‘wp_head’, ‘wp_shortlink_wp_head’, 10); // remove HTTP header // Link: <https://example.com/?p=25>; rel=shortlink remove_action( ‘template_redirect’, ‘wp_shortlink_header’, 11); } Tested in WordPress 4.4 and up to 4.9.1

Image slider to display at the very top of home page

Note: The slider only displays if you install the plugin and use the correct slider I.D in the code for the template tag after creating a slider and adding images. The screenshot i posted below proves my code works. Here’s the header.php code with the template tag for the slider on line 36 <?php /** … Read more

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