How to switch menu location in this header.php?

As far as I understand this would be one of the menus: $et_secondary_nav = $et_secondary_nav_items->secondary_nav; And this is the other: $primaryNav = wp_nav_menu( array( ‘theme_location’ => ‘primary-menu’, ‘container’ => ”, ‘fallback_cb’ => ”, ‘menu_class’ => $menuClass, ‘menu_id’ => ‘top-menu’, ‘echo’ => false ) ); This is where the first menu gets displayed: if ( ” … Read more

Stop plugin from adding cache headers

Add this file to your plugin folder. <?php /* Plugin Name: Remove cache headers Description: Remove Cache-Control and Pragram header Version: 0.1 Author: Deluxe Themes */ function varnish_safe_http_headers() { if( !session_id() ) { session_start(); } header_remove (‘Cache-Control’); header_remove (“Pragma”); } add_action( ‘send_headers’, ‘varnish_safe_http_headers’ );

Warning: Cannot modify header information – headers already sent by

OK. Thanks to @Milo and @Krzysiek Dróżdż I changed the code in index.html file and it works now. I put get_header() after redirection method. <?php if (is_user_logged_in()): ?> <?php $expensesFormPage = get_page_by_title(‘formularz wydatkow’); ?> <?php wp_redirect(get_permalink($expensesFormPage->ID)); ?> <?php else: ?> <?php get_header(); ?> <h1>Aby korzystać z aplikacji musisz się zarejestrować.</h1> <a href=”https://wordpress.stackexchange.com/questions/307132/<?php echo wp_registration_url(); ?>”>Zarejestruj … Read more

Adding custom html/css/images to Theme

If your HTML is displaying but the images aren’t that normally points to a path issue – doublecheck it by opening your browser’s dev tools and checking whether the requested path to the images is correct. Make sure you’re using get_stylesheet_directory_uri() to get the URI to the root of the child theme, as get_template_directory_uri() will … Read more

Enable CORS for getting an inline SVG by URL

By using custom rewrite_url, I was able to hijack the request and set its CORS-friendly headers. class Cors_Media { const QUERY_VAR = ‘cors_media_id’; public function init() { add_action(‘init’, [$this, ‘add_rewrite_rule’]); add_filter(‘query_vars’, [$this, ‘query_vars’]); add_action(‘template_redirect’, [$this, ‘template_redirect’]); } public function query_vars(array $qs) { $qs[] = ‘cors_media_id’; return $qs; } public function add_rewrite_rule() { add_rewrite_rule( ‘^cors_media_id/([0-9]+)/?’, ‘index.php?cors_media_id=$matches[1]’, … Read more

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