display dynamic WP Site logo on wp-admin using CSS

I'm looking for a way to always display the current site logo (as set in customiser) on the wp-admin page in place of the WP logo via CSS. I know how to manually add a custom image (code below is part of the function I use): #login h1 a, .login h1 a { background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/images/logo.png); background-size: contain; But I would like to make the entire URL dynamic, so the site logo can be changed in the customiser …
Category: Web

How do I handle the "WP_Customize_Cropped_Image_Control" callback?

I want to make a logo manager in the Customizer, but how do I set different image sizes with the WP_Customize_Cropped_Image_Control class? Example from Make WordPress Core: $wp_customize->add_control( new WP_Customize_Cropped_Image_Control( $wp_customize, 'cropped_image', array( 'section' => 'background_image', 'label' => __( 'Croppable Image' ), 'flex_width' => true, // Allow any width, making the specified value recommended. False by default. 'flex_height' => false, // Require the resulting image to be exactly as tall as the height attribute (default). 'width' => 1920, 'height' => …
Category: Web

Change logo url based on WP user role

I want to be able to change the WordPress default logo url (not the logo image) based on the user role. The image/logo will remain the same, only the url will change. Any assistance or ideas will be greatly appreciated.
Category: Web

How do I move my logo from the center to left (Pixgraphy theme)

I am trying to move my logo from the center of my page to the left side. I am using the "Pixgraphy" theme by "freesia" and it doesn't allow me to move it in the template whenever I try to paste custom CSS code in, it wont do anything and I'm a little afraid editing directly in the .php file due to previous syntax errors Hope someone out there can help me ( ps: I am not very skilled in …
Category: Web

How do you find the logo code on theme file or where can I find the header theme file?

I am trying to find the header.php file and/or the code for the logo on any theme file. Under appearance- editor section of my website ( www.pithandsubstance.com ) I can only find function.php and style.php files. Please note : I am new to Wordpress and highly detailed instructions will be very appreciated. Thank you in advance, PS
Category: Web

theme logo setting to template file

[![What is the setting to align top logo and components on home page on my website. www.radyohis.net][1]][1] [1]: https://i.stack.imgur.com/q9iXw.jpg [1]: https://i.stack.imgur.com/q9iXw.jpg
Topic: logo Wordpress
Category: Web

Load different logo on mobile

I’m creating a website for a charity, but haven't got a lot of experience. If you view the website on desktop (https://walkministries.org.uk/newsite/) the logo is blue on a light grey background. But when you switch to mobile, the logo moves to a different header area. On mobile, it loads onto a blue background. This makes the logo disappear because it’s the same colour as the background colour. Is there a way to load a different version of the logo for …
Topic: logo Wordpress
Category: Web

How to display custom logo on WordPress login page

I'd like to take a standard WordPress login page, change the WP logo to a custom image I create and that varies depending on site ID (WP Mulit-site). I've found this approach: WordPress login page logo customization function my_login_logo() { ?> <style type="text/css"> body.login div#login h1 a { background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/images/Logo-B-Classic.jpg); } </style> <?php } add_action( 'login_enqueue_scripts', 'my_login_logo' ); But I'm unsure how to best customize it to: Change the logo to a custom image based on site …
Category: Web

Change logo url link

I'm trying to change the logo url of the site to "mywebsite.com/side2", but it is not working, can anyone tell me where is the error in the code below? add_filter( 'login_headerurl', 'custom_loginlogo_url' ); function custom_loginlogo_url($url) { return home_url( 'side2' ); }
Category: Web

How do I add a logo to my website?

I would like to know how to do add a logo to my website, before the site title. <html <?php language_attributes(); ?>> <head> <meta charset="<?php bloginfo( 'charset' ); ?>" /> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="profile" href="http://gmpg.org/xfn/11" /> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" /> <?php /* Embeds HTML5shiv to support HTML5 elements in older IE versions plus CSS Backgrounds */ ?> <!--[if lt IE 9]> <script src="<?php echo get_template_directory_uri(); ?>/js/html5shiv.min.js" type="text/javascript"></script> <![endif]--> <?php wp_head(); ?> </head> <body <?php …
Category: Web

Provide logo in theme

I'm doing some small updates to a WordPress site which is managed as a git repository. The deployment process goes something like, commit to git, push to git repo, ssh to the instance, do a git pull. Now how can I update the site logo? The theme header is using the_custom_logo() and so from what I can tell this file has to be uploaded. The site and git repo already has a bunch of things in wp-content/uploads which is where …
Category: Web

How to set the WordPress logo programmatically with PHP

I am working on a WordPress theme. We implemented "One Click Demo Import" for the theme users to quickly populate their new blank theme with some dummy data. My question is, how can I set the logo of a WordPress site with PHP? This needs to be done inside an action. I call add_action( 'pt-ocdi/after_import', 'kinsley_ocdi_after_import_setup' ); and in the kinsley_ocdi_after_import_setup I need to run this processing code. This seems like it should not be hard to do, but I …
Category: Web

How to change logo by category

I have a multi-tiered Wordpress site that needs to have a different logo depending on what category is present. For example: The main page would have logo.png but the category adventure, and all of adventure's sub categories, would have adventurelogo.png. I tried: <?php if (is_category(10) || cat_is_ancestor_of(10, get_query_var('cat'))): ?> <script> document.getElementsByClassName('logo')[0].src ='adventurelogo.png'; </script> <?php endif; ?> But that did not seem to work. Does anyone know how this would be done? Thanks for your help!
Category: Web

Remove link around logo

I have this in the functions.php: add_theme_support( 'custom-logo', array( 'height' => 200, 'width' => 1000, 'flex-width' => true, 'flex-height' => true, ) ); and this in my header file: <div class="site-branding"> <?php the_custom_logo(); if ( is_front_page() || is_home() ) : ?> <h1 class="site-title"><?php bloginfo( 'name' ); ?></h1> <?php else : ?> <p class="site-title"><?php bloginfo( 'name' ); ?></p> <?php endif; $description = get_bloginfo( 'description', 'display' ); if ( $description || is_customize_preview() ) : ?> <p class="site-description"><?php echo $description; /* WPCS: xss …
Category: Web

How to properly set custom logo size?

According to the Codex page about adding a Custom Logo, one has to add the following code to functions.php: function themename_custom_logo_setup() { $defaults = array( 'height' => 100, 'width' => 400, 'flex-height' => true, 'flex-width' => true, 'header-text' => array( 'site-title', 'site-description' ), ); add_theme_support( 'custom-logo', $defaults ); } add_action( 'after_setup_theme', 'themename_custom_logo_setup' ); I'm not exactly sure about how the array values for height and width are used. The documentation says that are "expected sizes", but when I select an …
Category: Web

Add more then one site logo - custom-logo theme support

We can add one site logo to site customize with add_theme_support( 'custom-logo' ); How can add another logo? Seems like the custom-logo theme support only allows to add one site logo and I need to a footer logo as well I know its possible to add this to a custom theme settings page but prefer to add this to the customize screen same place where theme logo is added.
Category: Web

Header Image instead of dynamic text

i'd like to change the dynamic text in the header that makes the title of the site with a logo i've designed. how do i edit this code to achieve this? <div id="logo"> <?php $logo = $options['logo']; $retina_logo = $options['retina_logo']; $has_retina_logo = $retina_logo ? 'has-retina-logo' : ''; if ($logo != '') { ?> <a href="<?php echo home_url(); ?>"> <img class="<?php echo $has_retina_logo; ?>" src="<?php echo $logo; ?>" alt="logo"/> <?php if($retina_logo) { ?> <img id="retina-logo" src="<?php echo $retina_logo; ?>" alt="logo"/> <?php …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.